scsh-users
[Top] [All Lists]

(chdir) & fcntl(2)

To: scsh@martigny.ai.mit.edu
Subject: (chdir) & fcntl(2)
From: shivers@ai.mit.edu (Olin Shivers)
Date: 07 Sep 1996 22:28:15 -0400
Organization: Artificial Intelligence Lab, MIT
Reply-to: shivers@ai.mit.edu
   From: dmh@tibco.COM (David Hull)
   Newsgroups: comp.lang.scheme.scsh

   Accordint to the manual, (chdir) with no argument should chdir to
   home-directory.  It doesn't seem to.

   % scsh
   Scsh 0.4
   > (cwd)
   "/tmp/funny-file-names"
   > (chdir)
   > (cwd)
   "/tmp/funny-file-names"
   > home-directory
   "/tss/home2/dmh"
   > (chdir home-directory)
   > (cwd)
   "/tss/home2/dmh"


Well, I am embarrassed to report that this obvious bug is in the source
code:

    (define (chdir . maybe-dir)
      (let ((dir (:optional maybe-dir ".")))
        (%chdir (ensure-file-name-is-nondirectory dir))))

should be

    (define (chdir . maybe-dir)
      (let ((dir (:optional maybe-dir (home-dir))))
        (%chdir (ensure-file-name-is-nondirectory dir))))

We'll fix that up. Thanks for reporting it.

   BTW, I can't seem to find any reference to fcntl(2) in the manual.  Is
   this because it's not documented, or because it's not supported (e.g.,
   non-POSIX), or because I'm not looking hard enough?

What do you want to do? fcntl(2) isn't a specific thing, it's more of a grab
bag. Scsh does file locking with file-locking procedures, duping with duping
procedures. What's left, in POSIX, is getting status flags off of file
descriptors. I don't provide this. I should. Do you need it?
        -Olin

<Prev in Thread] Current Thread [Next in Thread>