Part of the Samples Website. 8/16/97.

samples.basicStuff.makeRoom

«Deletes half the files in Frontier's backup folder
«The backup command in the UserLand menu creates a trail of big files
«in the "backups" sub-folder. eventually, your disk will fill up!
«this script deletes half of those backups
local (backupfolder = Frontier.pathstring + "backups:")
local (ctfiles = file.filesInFolder (backupfolder, 1))
if not dialog.confirm ("There are " + ctfiles + " files in your backup folder.®®Delete half of them?")
return (false)
local (fname)
local (delete = false)
fileloop (fname in backupfolder) «delete every other file
if delete
delete = false «don't delete the next file
msg ("Deleting " + file.fileFromPath (fname) + ".")
file.delete (fname)
else
delete = true «delete every other file
local (volname = file.volumeFromPath (backupfolder))
msg (string.kBytes (file.freeSpaceOnVolume (volname)) + " free on " + volname)
return (true)


This page was last built on Sat, Aug 16, 1997 at 6:37:49 PM. You can download the current set of sample scripts from our FTP site. Dave