• 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: rm does not always remove immediately
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rm does not always remove immediately


  • Subject: Re: rm does not always remove immediately
  • From: Emmanuel <email@hidden>
  • Date: Tue, 12 Dec 2006 16:52:09 +0100

At 7:52 AM -0600 12/12/06, Luther Fuller wrote:
tell application "Finder"
if not (exists folder testFolderName of desktop) then
make new folder at desktop with properties {name:testFolderName}
set testFolder to the result as alias
else
set testFolder to (folder testFolderName of desktop) as alias
end if
--
make new folder at testFolder with properties {name:"x"}
set testItem to the result as alias
--
try
"rm -fr " & (quoted form of POSIX path of testItem)
do shell script the result
on error
display dialog "Error during rm"
return
end try
--
delay 3
if exists folder "x" of testFolder then
"It's still there!"
else
"It's gone!"
end if
display dialog the result
end tell


NOTICE: the difference in behavior between running the script with the folder "rm-test folder" closed vs open.

I think that this does not mean that "rm" does not remove, only that Finder is not aware.


If I replace the "delay 3 etc" part of your script by a simple "get blah as alias" (with no delay) I get the file not found error all right.

Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Re: equivalence mv file_or_folder ~/.Trash and tell app "Finder" to move file_or_folder to trash (From: Christopher Nebel <email@hidden>)
 >rm does not always remove immediately (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: rm does not always remove immediately
  • Next by Date: Re: Coercing document list to alias list
  • Previous by thread: Re: rm does not always remove immediately
  • Next by thread: Re: rm does not always remove immediately
  • Index(es):
    • Date
    • Thread