:: Re: [DNG] slashes in FAT file names
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Olaf Meeuwissen
Date:  
À: Hendrik Boom
CC: dng
Sujet: Re: [DNG] slashes in FAT file names
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.

> 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).

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


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

> 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.

# 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.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Software                        https://my.fsf.org/donate
 Join the Free Software Foundation              https://my.fsf.org/join