[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] 2 simple queries



At 17:01 +0100 4/10/97, Alan Fry wrote:
>With respect, that will delete "file", not move it into the TrashCan. On
>this machine at least just <rename "file", "HD:Trash"> will also delete
>"file".
>
>I don't think it is possible to move a file into Trash with MacPerl without
>deleting it. Not that one would want to do it anyway.

open TEST, ">Whidbey:Test" or die "Oops! $!";
close TEST;
rename "Whidbey:Test", "Whidbey:Trash:Test"


On this machine (8100 running MacOS 7.6), this code makes the file Test and
moves it to the trash.  If it is run again while the file Test is still in
the trash, the old Test is deleted and the new one assumes its place.
[Check the date in Get Info, close the trash window, run the code again,
open the trash window and check the date in Get Info.]

Whidbey: is not my startup drive.  My normal startup drive is Blake: but
when I run MPW, MacPerl (this was done in the MacPerl application...the MPW
tool might act differently since MPW installs itself as a foreign file
system to make the live editing windows work) or Python, my startup drive
is Patos:  [Extra credit:  tell me how I name my drives ;-)    .]



The thing that appears on the desktop labelled "Trash" is a virtual
container managed by Finder...each volume (except one on which it has never
been created) has its own invisible folder named Trash at the top
level...the user-visible Trash is the union of these (network-mounted
volumes complexify the above).

   --John

--
John Baxter (Born before ENIAC, but not by much.)
   jwblist@olympus.net      Port Ludlow, WA, USA



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch