• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
File kind from extension
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

File kind from extension


  • Subject: File kind from extension
  • From: Sam Goldman <email@hidden>
  • Date: Thu, 28 Feb 2002 22:28:52 -0800

I have recently resumed working on an FTP client after a short sabbatical
from programming altogether, and I have a few questions.

What is the best way to parse out the extension from a file name. I can see
a problem if there is a period in the middle of the name like this
(some.file.sit) and I start from the first period. If I start at the end of
the file name and the file is like this (some.file.tar.gz) I would only get
.gz when I want to get .tar as well. I think that I have found something in
launch services for this, but is that the *best* way?

I know how to get the proper icon once I have the extension with
NSWorkspace, but I want to be able to get the kind of file as well. Since
it's an FTP client, should I just make a .plist of common file extensions,
or can I get the kind from a built in source? By kind I mean "Stuffit
Archive" or "Zip Archive," not "image/png"

One reason I can see for making my own table is that it could also include
data that would determine if it should download in ASCII or BINARY data
transfer mode.

Thanks,
Sam

--
Windows is a 32-bit patch to a 16-bit shell for an 8-bit operating system
written for a 4-bit processor by a 2-bit company without 1 bit of sense.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: re Hiding controls and another question
  • Next by Date: Re: re Hiding controls and another question
  • Previous by thread: Re: re Hiding controls and another question
  • Index(es):
    • Date
    • Thread