• 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
Re: It can not be only me...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: It can not be only me...


  • Subject: Re: It can not be only me...
  • From: Christopher Nebel <email@hidden>
  • Date: Sat, 6 Dec 2003 00:06:54 -0800

On Dec 5, 2003, at 9:35 PM, Michael Terry wrote:

On Dec 5, 2003, at 8:28 PM, Deivy Petrescu wrote:

Since I have not heard it from any one of you, it seems that it can not be epidemic, however, I am getting some weird stuff with Posix file. E.g.:
___

set k to path to "cusr" as string
set pk to POSIX file k
pk --file ":.:SantosFC/Users/deivy/"

Since I see that someone has already answered, I'll just say that I, too, was confused by this result a few months ago. 'POSIX file', I thought to myself. 'That has something to do with UNIX, right? Isn't our shiny new OS expected to be POSIX compliant, you know, at some point? Then wouldn't a POSIX file be a slashy path to a file like in UNIX?' Of course, I didn't know what I'd do with a POSIX file once I had one, but whatever. No, instead, POSIX file takes a string, which is certainly not a POSIX file, and turns it into a Mac file, which is also not a POSIX file. Or maybe it is now, I guess.

You know, we thought this was obvious enough when we created it, but obviously it wasn't, because lots of people get screwed up by this. First off, a file is a file is a file. There aren't really two different kinds of files, there are two different ways of referring to files. "file" lets you give a "name" which is a Mac-traditional path; "POSIX file" lets you use a "name" which is a POSIX path. Both of these evaluate to a file object, and the canonical way to display one of those is as 'file "mac:traditional:path"'. Given a file object, you can get its Mac path by saying "as string", or get its POSIX path by asking for its "POSIX path" property.

"POSIX path" is mostly useful with "do shell script", since all shell commands take files as POSIX path strings. "POSIX file" is mostly useful either when "do shell script" spits out a file path, or when you want to get to a file that's in a location easier to specify POSIX-style, such as /etc/hostconfig.



--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: It can not be only me...
      • From: Walter Ian Kaye <email@hidden>
References: 
 >It can not be only me... (From: Deivy Petrescu <email@hidden>)
 >Re: It can not be only me... (From: Michael Terry <email@hidden>)

  • Prev by Date: Re: Folder actions for all users
  • Next by Date: Re: Reading resource forks
  • Previous by thread: Re: It can not be only me...
  • Next by thread: Re: It can not be only me...
  • Index(es):
    • Date
    • Thread