Question about PosixPathTools()

Having trouble using an XCmd or XFcn? Post your questions here.

Question about PosixPathTools()

Postby Dave_Higgins » Fri Mar 12, 2010 1:59 pm

Hi Terry.

I was wonder what the scope is for changeCurrentDirectoryPath and currentDirectoryPath. I'm not clear on the docs saying The current working directory is stored per task. What I'm wondering is how long the currentDirectory is maintained? For as long as SC is running? (That's what task means?) A quick test showed me that it is maintained across two different scripts being run.

I've been using PPTs on and off in a few projects, but generally have used long paths for each of the other calls, but I'm into one now that might make better use of these currentDirectory tools. I'm just looking ahead to make sure that I'm not going to find currentDirectory being reset to "/".

Also, in the docs, you include a param for thePath in posixPathTools("currentDirectoryPath",thePath), which I think is redundant, since it states:

Return Value
The path of the program’s current directory.
My two favorite teams are Detroit and whoever's playing Chicago.
User avatar
Dave_Higgins
 
Posts: 454
Joined: Mon Jul 07, 2008 9:50 am
Location: Dark Side Of The Moon

Re: Question about PosixPathTools()

Postby sctell » Sun Mar 14, 2010 11:14 am

Hi Dave,

I did miss your post.

This one first.

Also, in the docs, you include a param for thePath in posixPathTools("currentDirectoryPath",thePath), which I think is redundant


Yes, I think it is probably redundant as far as SC is concerned. I just created functions from NSFileManager.

I was wonder what the scope is for changeCurrentDirectoryPath and currentDirectoryPath. I'm not clear on the docs saying The current working directory is stored per task. What I'm wondering is how long the currentDirectory is maintained? For as long as SC is running? (That's what task means?) A quick test showed me that it is maintained across two different scripts being run.


Apple have changed their documentation to read:

Apple Docs:
All relative pathnames refer implicitly to the current working directory. The current working directory is stored per process.


Does this make it any clearer? I am assuming that in SC's case the process is SuperCard which would also suggest that it would be maintained for as long as SC is running.
sctell
 
Posts: 1128
Joined: Sun Jul 06, 2008 10:41 am


Return to Using Externals

Who is online

Users browsing this forum: No registered users and 1 guest