Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to filter fat32 illegal characters from directories and files?

0 views
Skip to first unread message

nospam

unread,
May 9, 2008, 9:31:17 PM5/9/08
to
These are illegal characters in a fat32 file system:

/ : ; * ? " < > |

So when I attempt to copy files which contain any of these characters to
my USB thumb drive which is a fat32 file system, it fails. I don't want
to format the thumb drive as anything else. Is there a script which will
traverse directories and files and strip these characters? I've google'd
groups and the web and can't seem to find anything! I don't want to
reinvent the wheel, but it looks as though I might have to. I'm
attempting this with a shell script, but having difficulties when
traversing sub-directories. Any examples would be appreciated too!

-Thanks

Ben Morrow

unread,
May 9, 2008, 11:10:56 PM5/9/08
to

Quoth nospam <n...@spam.com>:

> These are illegal characters in a fat32 file system:
>
> / : ; * ? " < > |

Presumably / also, if the FS is to be readable on Win32 systems.

> So when I attempt to copy files which contain any of these characters to
> my USB thumb drive which is a fat32 file system, it fails. I don't want
> to format the thumb drive as anything else. Is there a script which will
> traverse directories and files and strip these characters? I've google'd
> groups and the web and can't seem to find anything!

This is pretty trivial using File::Find and File::Copy (since FAT32
doesn't have any useful attributes anyway, the fact File::Copy doesn't
preserve them doesn't matter here).

Ben

--
'Deserve [death]? I daresay he did. Many live that deserve death. And some die
that deserve life. Can you give it to them? Then do not be too eager to deal
out death in judgement. For even the very wise cannot see all ends.'
b...@morrow.me.uk

szr

unread,
May 10, 2008, 3:50:59 AM5/10/08
to
Ben Morrow wrote:
> Quoth nospam <n...@spam.com>:
>> These are illegal characters in a fat32 file system:
>>
>> / : ; * ? " < > |
>
> Presumably / also, if the FS is to be readable on Win32 systems.

I believe you meant \ (back slash)

[...]

--
szr


0 new messages