Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'preflight checks on filenames?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
preflight checks on filenames?
Authored by: TrumpetPower! on Aug 04, '05 12:57:40PM

robdew wrote:

hayne wrote:

I've never understood why OS X "prechecks" file transfers for things like available space, but doesn't check the file names.

I suspect this is merely due to it being harder to do. To check for available disk space is quite easy. To do preflight checks on filenames would require knowledge of what is acceptable for a filename on the destination system. Sure, this could be built into the copying software but it would require substantial effort.

“Substantial effort” my ahhhh...foot. A simple regular expression is all you need. It's the sort of thing a first-semester programming student can handle.



[ Reply to This | # ]
preflight checks on filenames?
Authored by: adrianm on Aug 04, '05 01:54:48PM

Please supply this "simple regular expression" for all likely file system candidates, current, past and future.

[ Reply to This | # ]
preflight checks on filenames?
Authored by: diamondsw on Aug 04, '05 05:55:00PM

Not only will remote systems have differing filename conventions (lengths, allowable characters, etc), but then you'd have to check every single file before copying to see if it will work. Keeping track of space needed is simple, just have a long long of the total bytes needed. Checking the file names would either require creating a buffer of all of the names (fast, but memory-intensive), or checking each one as the algorithm goes (slow, but easier on memory). Either way, it will hurt performance *significantly*.

Why yes, I *do* have a BA in Computer Science.

[ Reply to This | # ]