Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#263 file created with :rename-and-delete option -- no new file!

lisp error
closed-works-for-me
Sam Steingold
clisp (525)
5
2005-09-23
2005-07-16
Jim
No

The following code returns T with:

$ clisp --version
GNU CLISP 2.33.2 (2004-06-02) (built 3330477674)
(memory 3330478213)
Software: GNU C 3.3 20030304 (Apple Computer, Inc.
build 1666) ANSI C program
Features:
(CLOS LOOP COMPILER CLISP ANSI-CL COMMON-LISP LISP=CL
INTERPRETER SOCKETS GENERIC-STREAMS LOGICAL-PATHNAMES
SCREEN FFI
UNICODE BASE-CHAR=CHARACTER UNIX)
Installation directory: /usr/local/lib/clisp/
User language: ENGLISH
Machine: POWER MACINTOSH (POWER MACINTOSH) thor.local
[192.168.1.101]

This means that the "newly created" file has the same
inode number as the original file. I think this is a bug!

(let* ((testfile "testfile"))

;; output to "testfile"
(with-open-file (output-stream testfile :direction
:output
:if-exists :overwrite
:if-does-not-exist
:create)
(format output-stream "random line one~%"))
;; print testfile's inode

(let ((first-inode (POSIX:file-stat-ino
(POSIX:file-stat testfile))))
;; output to new testfile
(with-open-file (output-stream testfile :direction
:output
:if-exists
:rename-and-delete
:if-does-not-exist
:create)
(format output-stream "random line two~%"))
;; print new testfile's inode
(equal first-inode (POSIX:file-stat-ino
(POSIX:file-stat testfile))
)))

Discussion

  • Jim
    Jim
    2005-07-16

    Logged In: YES
    user_id=99331

    OOPS! I'm using a couple additional packages from the
    "full" link set:

    $ clisp -K full --version
    GNU CLISP 2.33.2 (2004-06-02) (built 3330477674) (memory
    3330478265)
    Software: GNU C 3.3 20030304 (Apple Computer, Inc. build
    1666) ANSI C program
    Features:
    (SYSCALLS REGEXP CLOS LOOP COMPILER CLISP ANSI-CL
    COMMON-LISP LISP=CL INTERPRETER SOCKETS GENERIC-STREAMS
    LOGICAL-PATHNAMES SCREEN FFI UNICODE BASE-CHAR=CHARACTER UNIX)
    Installation directory: /usr/local/lib/clisp/
    User language: ENGLISH
    Machine: POWER MACINTOSH (POWER MACINTOSH) thor.local
    [192.168.1.101]

     
  • Sam Steingold
    Sam Steingold
    2005-08-28

    Logged In: YES
    user_id=5735

    This is not a bug.
    CLISP does what the spec requires:
    renames the existing file and removes it
    - before creating it anew.
    since all this is done in rapid succession,
    no wonder the OS re-uses the inode.
    try this:
    1. create a file.
    2. open it in another application, e.g., with "tail -f"
    3. while it is open by "tail -f",
    rewrite it in clisp with :rename-and-delete
    4. observe that the inode is now different.

     
  • Sam Steingold
    Sam Steingold
    2005-09-08

    Logged In: YES
    user_id=5735

    This bug report is now marked as "pending"/"works for me".
    This means that we think that we cannot reproduce the problem
    and cannot do anything about it.
    Unless you - the reporter - act within 2 weeks,
    the bug will be permanently closed.
    Sorry about the inconvenience -
    we hope your silence means that
    you are no longer observing the problem either.

     
  • Sam Steingold
    Sam Steingold
    2005-09-08

    • status: open --> pending
     
  • Sam Steingold
    Sam Steingold
    2005-09-08

    Logged In: YES
    user_id=5735

    see the new test in clisp/modules/syscalls/test.tst

     
  • Sam Steingold
    Sam Steingold
    2005-09-08

    • status: pending --> pending-works-for-me
     
    • status: pending-works-for-me --> closed-works-for-me
     
  • Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).