Adding PC Filename Extensions to Macintosh Filenames

Roman Suzi rnd at onego.ru
Wed Aug 6 00:26:02 EDT 2003


On Tue, 5 Aug 2003, hokiegal99 wrote:

>I've written a small script (with much help from this list) that 
>searches through a directory for files without a PC filename extension 
>like .doc .xls and then adds them. The reason for writing the script is 
>that I'm migrating several dozen Mac users to PCs over the next few 
>months and many of the Mac files do not have PC filename extensions. 
>There are thousands of these files. The script runs on a Linux ftp 
>server where the files are upload to.

Hmmm... First of all, files from Mac contain so called resource fork,
which IIRC contains type information (4-letter). So instead of 
trying to wildly guess file type, it is possible to get it for sure.

Second, Linux has 'file' command which tells you file type based on
content and knows tonns of formats.

-- 
rnd at onego.ru =\= My AI powered by GNU/Linux RedHat 7.3






More information about the Python-list mailing list