Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't convert path ~/... to Fsref



If you can't be civil, go figure it out yourself. Don't pester the list.
Apple has lots of options for path expansion. NSString is the easiest. Glob is pretty easy too. Both were mentioned already.
Anyway, if you want something easy and Linux-friendly, use fopen. It works natively with UTF8 and long filenames. Its limitations almost certainly won't bother you (it can't use paths longer than 1,024 characters and cannot easily access Mac-specific metadata). Works great with Carbon.



On Sep 29, 2005, at 5:15 PM, Denis @ TheOffice wrote:

What the .. do you know about.what I have done
I said alternative that would easily fit  in the code I am working on.

If it was a brand new software project I would be much less limited.

What I would need and can figure out how come the Apple didn't think of it.
is to be able to go from Linux style posix (even with the ~) and then back to FSRef.
Or vice versa.



----- Original Message ----- From: "John Stiles" <email@hidden> To: "Denis @ TheOffice" <email@hidden> Cc: "Laurence Harris" <email@hidden>; <email@hidden> Sent: Thursday, September 29, 2005 7:58 PM Subject: Re: Can't convert path ~/... to Fsref



Alternatives abound. FSRef is the most common choice; if you want to
point to a nonexistent file, use a FSRef to the parent plus a UniChar
array.
It really sounds as if you haven't done any research at all. Apple's
web site has all sorts of information on this stuff.


On Sep 29, 2005, at 5:02 PM, Denis @ TheOffice wrote:


Yeah, but the only thing that goes in a FSSpecs is a Pascal string,
I am not liking it either.
But there is not seems to be any alternative that would easily fit
in the code I am working on.


----- Original Message ----- From: "Laurence Harris" <email@hidden> To: "Denis @ TheOffice" <email@hidden>; <carbon- email@hidden> Sent: Thursday, September 29, 2005 7:38 PM Subject: Re: Can't convert path ~/... to Fsref




On 9/29/05 5:10 PM, Denis @ TheOffice didst favor us with:



Why are you using paths and FSSpecs?


That is temporary until I rewrite all my file access routines.



Are you aware that this function
can fail because not all file names can be encoded into a Pascal
string, and
that only the first 31 characters of that field are used?


Yes, I am aware, In another function it wants the OutFSSpec->name
in pascal.

The actual path of "~/..." may come from user entry and or some
internal code
that assume Linux
style.



If the path can come from user entry then there should be no Pascal strings anywhere in this process. OTOH, you probably know more about all this than I do, so never mind. ;-)

Larry





----- Original Message -----
From: "Laurence Harris" <email@hidden>
To: "Denis @ TheOffice" <email@hidden>; <carbon-
email@hidden>
Sent: Thursday, September 29, 2005 4:31 PM
Subject: Re: Can't convert path ~/... to Fsref




On 9/29/05 4:28 PM, Denis @ TheOffice didst favor us with:



Re: Can't convert path ~/... to FsrefThanks,
But, I fail to see how to integrate that into my code.
I am trying to do a generic function that will handle all
possible entry.
Plus I was hopping for something in Carbon.



Why are you using paths and FSSpecs? Why not FSRefs? Where are you getting these paths that they have tildas in them? Are you aware that this function can fail because not all file names can be encoded into a Pascal string, and that only the first 31 characters of that field are used?

Larry





----- Original Message -----
From: Rosyna
To: Denis @ TheOffice ; email@hidden
Sent: Thursday, September 29, 2005 4:01 PM
Subject: Re: Can't convert path ~/... to Fsref


man 3 glob


http://developer.apple.com/documentation/Darwin/Reference/ ManPages/man3/glob .3 .html


Ack, at 9/29/05, Denis @ TheOffice said:


I am trying to create/open a file with the origine in posix example "~/Library/Preferences/temp.tiff"

I have made a function to convert based on some example I have
found...
It works most of the time but seems to failed with the TILDE(~)
current
user...
The RetStatus is -43 rectory not found...


--






 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/jstiles%
40blizzard.com

This email sent to email@hidden





_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Can't convert path ~/... to Fsref (From: Laurence Harris <email@hidden>)
 >Re: Can't convert path ~/... to Fsref (From: "Denis @ TheOffice" <email@hidden>)
 >Re: Can't convert path ~/... to Fsref (From: John Stiles <email@hidden>)
 >Re: Can't convert path ~/... to Fsref (From: "Denis @ TheOffice" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.