Ignore:
Timestamp:
Apr 14, 2011, 3:53:47 PM (8 years ago)
Author:
rme
Message:

Merge r14662 from trunk.

Closes ticket:843.

Location:
release/1.6/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/1.6/source

  • release/1.6/source/level-1/l1-files.lisp

    r14453 r14712  
    213213  (when (directory-pathname-p path)
    214214    (return-from %create-file (probe-file-x path)))
    215   (assert (or (eql if-exists :overwrite)
    216               (null if-exists)
    217               (eq if-exists :error)
    218               (not (probe-file path))) ()
    219           "~s ~s not implemented yet" :if-exists if-exists)
    220215  (let* ((unix-name (native-translated-namestring path))
    221          (fd (fd-open unix-name (logior #$O_WRONLY #$O_CREAT #$O_TRUNC
    222                                         (if (or (null if-exists)
    223                                                 (eq if-exists :error))
    224                                           #$O_EXCL
    225                                           0)))))
    226     (if (< fd 0)
    227       (if (and (null if-exists)
     216         (fd (fd-open unix-name (logior #$O_WRONLY #$O_CREAT
     217                                        (if (eq if-exists :overwrite)
     218                                          #$O_TRUNC
     219                                          #$O_EXCL)))))
     220    (when (and (neq if-exists :error)
    228221               (or (eql fd (- #$EEXIST))
    229222                   #+windows-target
    230223                   (and (eql fd (- #$EPERM))
    231224                        (probe-file path))))
    232         (return-from %create-file nil)
    233         (signal-file-error fd path))
     225      (when (null if-exists)
     226        (return-from %create-file nil))
     227      (error "~s ~s not implemented yet" :if-exists if-exists))
     228
     229    (if (< fd 0)
     230      (signal-file-error fd path)
    234231      (fd-close fd))
    235232    (%realpath unix-name)))
Note: See TracChangeset for help on using the changeset viewer.