:: Re: [DNG] slashes in FAT file names
トップ ページ
このメッセージを削除
このメッセージに返信
著者: Hendrik Boom
日付:  
To: dng
題目: Re: [DNG] slashes in FAT file names
On Sat, Dec 22, 2018 at 05:15:55PM +0900, Olaf Meeuwissen wrote:
> Hi Hendrik,
>
> Hendrik Boom writes:
>
> > I have a 32GiB microSD card an am reying to read it on my Devuan system.
> > I munted it with a simpel mount /dev/sdb1 /nedia/hendrik/
>
> You might want to try adding a suitable mount option there. Not sure if
> it's mounted as FAT or VFAT or whatever, but scour the options part of
> the appropriate manual page.


The mount command tells me it already *is* mounted as VFAT.
Which is what I's expect of a 32G sd card -- presumably SDHC.

>
> > It reads almost everything fine, except for a few files whose names
> > contain '/' characters. I can handle the other horribly weird
> > characters in file names
>
> Here `convmv` might come in handy. I often use that to clean up the
> "mess" after extracting zip archives with Shi*t_JIS file names on a
> UTF-8 using file system. Guessing your "horribly weird characters" are
> ISO-8859-{1,4,10,15}, (or whatever IBM code page Microsoft saw fit to
> appropriate for those).


As long as convmv uses the file system provided by the kernel, it will
treat slashes as directory name separators. It looks like a mechanism
to use when names are untypeable. But it looks as if it uses the
kernel's rename facility just like anything else.

Still, something to try when other attacks have failed.

>
> > -- emacs Rename in the directory editor works just fine. But the
> > names containing '/'s even have emacs stymied.


Presumably because of the same kernel's file-system's name restrictions

>
> # Hoping that Emacs on Windows isn't ;-) But fully expect it to be
> # stymied by file names with a `\` in it :-P


Worth a try if I get to a Windows system.

-- hendrik


>
> > ls -l lists them like this:
> >
> > -rw-r--r-- 1 hendrik hendrik       0 Sep  1  2007 06 - Track 6.mq3
> > -????????? ? ?       ?             ?            ? 07/TRA~1.MP3
> > -rw-r--r-- 1 hendrik hendrik 3585716 Sep  1  2007 08-URA~1.MP3

>
> That `~1` looks a lot like you are actually dealing with a VFAT file
> system. How do things look after a
>
> mount -t vfat /dev/sdb1 /media/hendrik/
>
> > With the slash, it can't even figure out the permissions, ownership, or
> > file size. Preumably some parts of the system interpret the '/' as the
> > directory name separator, and in this file system that's not what it
> > is.
>
> On any Unix-like system I've come across the '/' (and '\0') are about
> the only character that cannot be used in a filename. As mentioned
> above check the mount.vfat (or mount.fat or mount.cifs?) manual pages
> for options that might transparently "fix up" the file name.


It is already mounted as a vfat filesystem.
The vfat uni_xlate offers faint hope, because it translates the
character set. It converts odd Unicode characters in file names using
escape sequences involving ':', because ':' is apparently illegal in
VFAT file names. (perhaps a drive letter designator on Windows?)

Perhaps, just perhaps, it treats a slash to be a Unicode vagary?
Unlikely, but worth a try.

>
> # Yes, you can use `\n` in a file name ... but please don't.
>
> > Does anyone have any ideas here other than begging, borrowing, or
> > buying a Windows system?
>
> It's an SD card, right? Asking a friendly neighbour to rename the
> file(s) in question may be the quickest way out of your conundrum.


Yes, indeed, but it would not be good publicity for Linux. A secondary
consideration.

-- hendrik