Comedy Of Errors

chaoticset on 2002-10-25T18:34:42

Outlook, in its infinite wisdom, produced a directory of files named the email they contained.

And Windows 2000, in its infinite wisdom, will not handle filenames longer than a certain length.

The upshot of this is that the script which should be able to burn through a whole directory of student emails and attempt to filter filth from them is stopped cold merely because one lone student decided to send an email named 'doooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooood'. Further, it fails silently (possibly because there's really such a low-level system issue with the filename being a couple hundred characters). Even worse, it only gets through 91 messages out of 1600 or so.

Just have to zip over to the Cougar and see about that "check if the file's working, if not, skip and keep going" script. I may have to write something that parses a Win2K dir output, too, because opendir fails silently and disgustingly at email 91.

This is all assuming there's no way to delete that file that Les can find without me. There's got to be a way. I mean, something has to be able to delete it...

...right?


DOS file names

bart on 2002-10-27T00:27:23

Your problem is getting rid of a file with a far too long name? Have you thought of using the 8.3 filename (AKA "DOS", or "short" file name) to identify the file? In case you didn't know: ActivePerl has some functions to convert the long file name to the short file name and vice versa, built in. See `perldoc win32`, under "Win32::GetLongPathName" and "Win32::GetShortPathName".

Granted, I don't have W2k here, so I can't be 100% sure it actually works.

Re:DOS file names

gav on 2002-10-27T02:06:56

A dir /x will do the trick and show the 8.3 names. This works for those 'undeletable' files and folders.