[plt-scheme] Fooling around w/files and directories

From: John Chandler (jmcaxolotl at gmail.com)
Date: Mon Jun 22 22:07:12 EDT 2009

There are occasionally little things I like to automate, even just
once, because I need to perform the same tedious operation on 25
separate files, or something.  And I thought that actually wanting to
accomplish something might be a good motivation for learning at least
certain aspects of Scheme.  The Teachpack, dir.ss seems to offer
what's needed, but when I try to follow the doc for this, I hit an
error right away.  It seems quite likely that I am *completely*
missing a key concept here, because I was trying to follow slavishly
hoping I'd catch on to the underlying principles eventually.  Blind
pig, acorn, etc.

I added the teachpack, dir.ss, clicked Run, and not a whole lot
happened.  I looked at the next step in the doc, and it seemed to show
a number of s-exps right after a ">".  So I typed in the first s-exp,
and pressed Return.  I got this:

    directory-list: could not open "/.Spotlight-V100/" (Permission
denied; errno=13)

The same thing happened when I pasted the whole set of s-exps into the
upper window and clicked Run again.

As I say, this failure is so complete that I think I must have missed
something crucial early on, but I confess I don't have the patience to
run through all the picture-drawing stuff right now, just in case the
first lesson contains the answer.  I did skim that lesson and I didn't
find the clue I needed.

So, OK, I am clue-challenged, and I hope someone out there has one to
toss me.

The main thing is, I want to fool with files and directories, get info
on files, e.g., size, remove and add file suffixes, maybe get
checksums on files, etc.  I'd like to see how easy or horrible that is
with Scheme.  I thought dir.ss might be the place to start, but at
this point, everything I know could be wrong.



Posted on the users mailing list.