Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / April 2005



Tip: Looking for answers? Try searching our database.

Dumb open file problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy Bettis - 25 Apr 2005 08:23 GMT
Hi folks,

I'm working on a test app that needs to be able to open any text file,
regardless of creator, as it's a prototype for a cross-platform program.
I'm using Nav Services (via Power Plant) and have set up the creator
code as '????' and the file type as 'TEXT', and this seems to work fine.
However I've been sent some Windows files that I need to open, which
arrived with a strange extension which made the system think they were
Unix executables?!? I changed the extension to .txt and they now show up
as plain text documents with Get Info, however the app still won't open
them. I can open them with the IDE, but as they contain some binary data
the IDE 'corrects' them and changes the contents. If I remove the binary
data and save them in the IDE they show up in my app's open file dialog.
I've tried setting the Nav Services signature to kNavGenericSignature
but to no avail.

Any suggestions?

Rev. Andy
David Phillip Oster - 25 Apr 2005 08:35 GMT
> I'm working on a test app that needs to be able to open any text file,
> regardless of creator, as it's a prototype for a cross-platform program.
[quoted text clipped - 11 lines]
>
> Any suggestions?

How is your Info.plist (or 'plst' 0 resource) set up? It is used by
Launch Services, and hence the Finder to know what kinds of files are
legal to drop on your application icon.

See the tech note on 'plst' 0 resources on developer.apple.com for more
information about that.

For Nav Services filtering, if you can't trust the OSType file type,
then you'll have to have Nav Services call your filter function, which
is allowed to open the file and read the first few 100 bytes to
determine if it should enable the item in the Nav Services dialog.

How are you 'open' and 'kind' resources set up? What are you actually
passing to Nav Services?

You seem to misunderstand what the Nav Services "signature" is for. You
might want to recheck the documentation on this.

Signature

David Phillip Oster

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.