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

Re: [MacPerl] deleting the desktop database?



At 09.13 -0500 1998.06.12, Paul J. Schinder wrote:
>} for a script that is in shutdown folder, i want to destroy the
>} desktop-database (the 2 files "Desktop DB" and "Desktop DF" )
>} in order to reconstruct them at every boot.
>}
>} Is there a way to do that (FspDelete doesn t work and a call to AS to
>} move those 2 files in the trash doesn t work anymore...)
>
>To remove a file in Perl, use unlink().  But there's a chance this may fail
>if the file is open by something else (a real possibility with the Desktop
>files).  I've never experimented to find out whether you can unlink() an
>open file in MacOS.
>
>You can move them to the Trash in Perl with rename().  The Trash is an
>invisible folder in the top level of whatever drive the file is on.

I think to delete the database files, they need to be quit the Finder
first.  Mac::Apps::Launch should do the trick.  Quit the app id MACS, then
delete the file, then quit all other open apps to restore the Finder.

Could be dangerous, so be careful.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])



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