Changeset 13384


Ignore:
Timestamp:
Jan 12, 2010, 10:02:16 PM (10 years ago)
Author:
gb
Message:

In GEN-FILE-NAME, use RANDOM (rather than FILE-WRITE-NAME) to generate
a proposed file name for (OPEN ... :IF-EXISTS :SUPERSEDE).

In %CREATE-FILE: if :IF-EXISTS is NIL and Windows returns EACCESS, treat
that as "file exists" and return NIL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-streams.lisp

    r13368 r13384  
    58105810
    58115811(defun gen-file-name (path)
    5812   (let* ((date (file-write-date path))
    5813          (tem-path (merge-pathnames (make-pathname :name (%integer-to-string date) :type "tem" :defaults nil) path)))
     5812  (let* ((base (random (ash target::target-most-positive-fixnum -1)))
     5813         (tem-path (merge-pathnames (make-pathname :name (%integer-to-string base) :type "tem" :defaults nil) path)))
    58145814    (loop
    58155815      (when (%create-file tem-path :if-exists nil) (return tem-path))     
    5816       (setf (%pathname-name tem-path) (%integer-to-string (setq date (1+ date)))))))
     5816      (setf (%pathname-name tem-path) (%integer-to-string (setq base (1+ base)))))))
    58175817
    58185818(defun probe-file-x (path)
Note: See TracChangeset for help on using the changeset viewer.