Another basic... delete - shell script
Another basic... delete - shell script
- Subject: Another basic... delete - shell script
- From: email@hidden
- Date: Thu, 5 Feb 2004 09:18:20 +0000
Hi all,
Sorry for maybe asking the obvious (again)... but I seem to be
struggling with compatibility so...
Not wanting to clutter up the Trash, I use the following when deleting
some files:
on delete_file(the_file)
try
tell application "Finder" -- zero out the file and delete it
set file type of file the_file to " "
set trash_temp to open for access file the_file with write permission
set eof of trash_temp to 0
close access trash_temp
delete (file the_file)
end tell
end try
end delete_file
Now this works fine, moving the selected file to the Trash with a size
of 0KB, as expected.
For compatibility's sake, would it be safe to use the following in
Jaguar/Panther for any account type (admin/guest) users without any
need for password?
on delete_file(the_file)
do shell script "rm " & (quoted form of POSIX path of the_file) --
the_file is a Unicode string
end delete_file
Just so that the trash doesn't end up with loads of 0KB files.
Thanks for any pointers.
--
DP
_______________________________________________
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.