Hello Michael.
The only thing you are achieving using find in this way, is passing
the correct name to cp. If you have problems with your shell, or your
environment (terminal, etc...) passing some characters to your commands,
this may be useful for you. But that is not the problem I'm talking about
(In fact, with linux and sh if some file name has a ':' you can just type
it). The problem is that if the name contains ':' the netbsd
implementation of ntfs is going to treat it as a query of attributes.
For example, ls will show the file names (e.g. file:h.ext), but 'ls -l' or
'ls -i' is going to give the error:
ls: file:h.ext: No such file or directory
As I see it, and please correct me if I'm wrong, the problem is that the
implementation of the file system is taking for sure that ':' can't be in
a file name, so is fine to use it for querying attributes.
Regards,
trebol.
On Fri, 10 Nov 2017, Michael Parson wrote:
On 2017-11-10 04:21, trebol wrote:
Hello,
I'd appreciate it if someone could tell me how to copy a file from a
ntfs partition with a colon in its name. This character is used to get
files attributes, and I can't find a way to avoid it.
I don't have any NTFS stuff mounted on NetBSD, but I tried this on my laptop
running Linux (Dual-boots Win 10, windows partition is mounted on /windows):
Use 'ls -li' to get the inode of the file (first column)
Then use 'find . -maxdepth 1 -inum $inode -exec cp {} /tmp/new_filename.ext
\;'
You can also use this to rename or remove files with chars that aren't
supposed to exist in filenames or aren't otherwise easily typeable.
--
Michael Parson
Pflugerville, TX
KF5LGQ