Why is dump-scsh-program failing here?

Eric Hanchrow <[email protected]> Thu, 18 May 2006 22:48:42 -0700
Newsgroups gmane.lisp.scheme.scsh
Message-ID <[email protected]>
This is 0.6.6.

Make this executable, make sure you don't have write access to /, then
execute it with no arguments.

    #!/usr/local/bin/scsh \
    -e compile -s
    !#

    (define (compile args)
      (with-cwd "/" 0)
      (dump-scsh-program main "plop"))

    (define (main args)
      'nada)

I see 

    Error: exception
           cannot-open-channel
           (write-image 13 "plop" '#{Procedure 3927 (unnamed in usual-resumer
    in usual-resumer)} "Scsh 0.6" "Permission denied")

But comment out the 'with-cwd' form, and it works.

Why is this happening?

-- 
There is such a thing as American-ness.  ... [H]ackers ... come
closest of any group I know to embodying it.  Closer, probably, than
the men running our government.
        -- Paul Graham