Ignore:
Timestamp:
Jan 26, 2008, 5:15:02 PM (12 years ago)
Author:
gb
Message:

changes from working-0711 branch

File:
1 edited

Legend:

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

    r8237 r8286  
    184184
    185185(defun create-file (path &key (if-exists :error) (create-directory t))
    186   (native-to-pathname (%create-file path :if-exists if-exists
     186  (let* ((p (%create-file path :if-exists if-exists
    187187                                      :create-directory create-directory)))
     188    (and p
     189         (native-to-pathname p))))
     190
    188191(defun %create-file (path &key
    189192                         (if-exists :error)
     
    195198  (assert (or (eql if-exists :overwrite)
    196199              (null if-exists)
     200              (eq if-exists :error)
    197201              (not (probe-file path))) ()
    198202          "~s ~s not implemented yet" :if-exists if-exists)
    199203  (let* ((unix-name (native-translated-namestring path))
    200204         (fd (fd-open unix-name (logior #$O_WRONLY #$O_CREAT #$O_TRUNC
    201                                         (if (null if-exists)
     205                                        (if (or (null if-exists)
     206                                                (eq if-exists :error))
    202207                                          #$O_EXCL
    203208                                          0)))))
    204209    (if (< fd 0)
    205       (if (eql fd (- #$EEXIST))         ; #$O_EXCL was set and file exists
     210      (if (and (null if-exists)
     211               (eql fd (- #$EEXIST)))
    206212        (return-from %create-file nil)
    207213        (signal-file-error fd path))
Note: See TracChangeset for help on using the changeset viewer.