From: Chad Perrin Date: 2007-02-25T04:26:04+09:00 Subject: Re: How can i determine the file type? On Sat, Feb 24, 2007 at 05:35:42PM +0900, Chris Shea wrote: > > If you're trusting the file extension (which I see no problem with), and That probably wouldn't be my preferred approach. Trusting file extensions is only a mostly-solution, and only on platforms where file extensions are used by applications to determine whether they should try to open the files. Relying on the file extension to determine filetype leads to issues with both portability and security, in my experience. On the other hand, if this is only for personal use and meant to be something of a throw-away script, I'm sure that doesn't matter much. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] "The ability to quote is a serviceable substitute for wit." - W. Somerset Maugham