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

samples.NewIn97.buildTestFolders

«Creates a randomly complex set of folders and files.
«I needed this to test the Reconcile Folders command in FinderMenu
«Tue, Feb 11, 1997 at 3:18:09 AM by DW
local (folder = "Jaz Disk 1:Reconcile Testing:Source Folder:")
if file.exists (folder)
file.deleteFolder (folder)
local (level = 0, maxlevel = 7)
on createSubs (folder)
local (i, ctsubs)
ctsubs = random (1, 8)
file.sureFolder (folder)
for i = 1 to ctsubs
local (f = folder + states.nthState (i))
if random (0, 2) == 0
level++
if level <= maxlevel
createSubs (f + ":")
level--
else
msg (f)
toys.writeWholeFile (f, string (f), 'TEXT', Netscape.id, clock.now ())
createSubs (folder)


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