On Apr 25, 2006, at 4:38 PM, Sven E Olsson wrote:
On 25 apr 2006, at 23.26, Jonathan Johnson wrote:
On Apr 25, 2006, at 4:19 PM, Sven E Olsson wrote:
extension to jpg .. and then you have an none valid file, that
NOT would be displayed in the OpenDialog box as MacType TEXT
because there is no MacType.
Of course, the reason to support MacTypes is because you can also
blindly remove the extension entirely. If you have a file that
*does* have a MacType that is correct, and you specify both a
MacType and extension, it will work properly in all cases. If you
simply specify a dummy MacType, it won't work if the file ends up
without an extension, because you didn't specify a MacType that
matched.
-Jon
This is very interesting, could an xml file (vaild) have another
extension that .xml or none?
Yes. Xhtml comes to mind, rss feeds, etc.
Could an valid html file have an extension .txt ? or .jpg?
Yes, it could, depending on how it was written.
The moral of the story is while all what Joe is suggesting will help
filter files more accurately and more to the common experience on the
Macintosh, you should never rely on the extension or MacType when
reading a file. Instead, as you're opening the file, try to examine
the data to figure out what format it's in. Most files have a few
bytes up front that serve as a "magic" code.
-Jon
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>