Click here to get back home

How to filter fat32 illegal characters from directories and files?

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
How to filter fat32 illegal characters from directories and files? nospam 05-09-2008
Get Chitika Premium
Posted by nospam on May 9, 2008, 9:31 pm
Please log in for more thread options
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

Posted by Ben Morrow on May 9, 2008, 11:10 pm
Please log in for more thread options

> 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.'
ben@morrow.me.uk

Posted by szr on May 10, 2008, 3:50 am
Please log in for more thread options
Ben Morrow wrote:
>> 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



Similar ThreadsPosted
illegal young teen free illegal young very young illegal illegal young pics September 12, 2008, 5:38 pm
Getting all directories/files from current directory and using -d flag for the directories October 8, 2004, 2:05 pm
filter characters from libcurses. July 14, 2005, 8:32 pm
Recognize directories and files. December 9, 2004, 7:39 pm
move 7500 files to various directories September 14, 2004, 9:23 am
Using File::Find to delete files and directories older than 30 days March 2, 2006, 5:40 pm
Illegal cp September 12, 2008, 5:40 pm
Extracting Directories and Sub Directories and Counting November 1, 2004, 9:48 pm
Illegal seek April 13, 2007, 5:09 pm
illegal pedo September 12, 2008, 5:41 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap