Re: R é p: duplicate
Re: R é p: duplicate
- Subject: Re: R é p: duplicate
- From: Yvan KOENIG <email@hidden>
- Date: Tue, 10 Oct 2006 21:13:29 +0200
Le 10 oct. 2006 à 19:18, Paul Berkowitz a écrit :
On 10/10/06 6:44 AM, "ishmael" <email@hidden> wrote:
I didn't know you could retrieve the path of the
system temp with (path to
"temp" from user domain),
Actually, using that 4-character text version dates from a time
when there
was no officially documented way to get at many special folders. It
still
works, and I suppose it will continue to do so for the foreseeable
future,
but most of these special folders are now documented in the 'path to'
command in Standard Additions dictionary.
path to temporary items from user domain
In fact , I'm not sure 'from user domain' is correct here, although
the
Cache file it finds probably points to or mirrors the actual
location. Temp
folders are in fact not within the user folder but on the root disk:
path to temporary items from user domain
--> alias "PB G5 HD
Tiger:Users:berkowit:Library:Caches:TemporaryItems:"
path to temporary items
--> alias "PB G5 HD Tiger:private:var:tmp:folders.
501:TemporaryItems:"
The latter is the real location - a hidden (private) folder. I'm
not sure
how far back (which OS) the ~/Library/Caches/ location goes back to
- I
don't think I've seen it before. It must be a sort of mirror of the
real
location.
--
Paul Berkowitz
Hello
I made tests to check if you where right.
It seems that you aren't.
I ran this short script:
--[SCRIPT]
set origName to "cherche_arrow.scpt"
set sourceFile to ("" & (path to desktop) & origName) as alias
set tempFolder1 to (path to temporary items from user domain) as alias
set tempFolder2 to (path to temporary items) as alias
tell application "Finder"
set tempFile to duplicate sourceFile to tempFolder1 with replacing
delay 0.2
try
delete file ("" & tempFolder2 & origName)
on error
log "missing"
end try
delay 0.2
try
delete file ("" & tempFolder1 & origName)
end try
end tell
--[/SCRIPT]
The log report is:
tell current application
path to desktop
alias "Macintosh HD:Users:yvankoenig:Desktop:"
path to temporary items from user domain
alias "Macintosh HD:Users:yvankoenig:Library:Caches:TemporaryItems:"
path to temporary items
alias "Macintosh HD:private:var:tmp:folders.501:TemporaryItems:"
end tell
tell application "Finder"
delete file "Macintosh HD:private:var:tmp:folders.
501:TemporaryItems:cherche_arrow.scpt"
(*missing*)
delete file "Macintosh
HD:Users:yvankoenig:Library:Caches:TemporaryItems:cherche_arrow.scpt"
document file "cherche_arrow 21-05-50.scpt" of trash
end tell
Trying to delete my file from tempFolder2 failed
while deleting from tempFolder1 (the one from user domain) succeed!
lt seems clear that my file was not stored in the folders.
501:TemporaryItems one but in
Library:Caches:TemporaryItems.
I also tryied with a simple
exists file ("" & tempFolder2 & origName)
to be sure that there was not some locked feature in this folder.
Now, for the french old guy, it's time to unplug the mac.
"See" you tomorrow.
Yvan KOENIG _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden