Ignore:
Timestamp:
Sep 25, 2008, 1:25:13 PM (11 years ago)
Author:
gb
Message:

Stub out (or sometimes, actually implement) a few more things on
Windows; now compile without warnings on Windows.

File:
1 edited

Legend:

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

    r10825 r10878  
    451451    win))
    452452
     453#+windows-target
     454(defun copy-file-attributes (source-path dest-path)
     455  "could at least copy the file times"
     456  (declare (ignore source-path dest-path)))
     457
     458
    453459#+linux-target
    454460(defun %uname (idx)
     
    526532              (eql (schar namestring 1) #\/))
    527533        (concatenate 'string (get-user-home-dir (getuid)) (if (= len 1) "/" (subseq namestring 1)))
     534        #+windows-target namestring
     535        #-windows-target
    528536        (let* ((slash-pos (position #\/ namestring))
    529537               (user-name (subseq namestring 1 slash-pos))
     
    641649           (%get-cstring (pref pw :passwd.pw_name))))))))
    642650
     651#+windows-target
     652(defun %file-author (namestring)
     653  (declare (ignore namestring))
     654  nil)
     655
    643656#-windows-target
    644657(defun %utimes (namestring)
     
    648661      (or (eql err 0)
    649662          (%errno-disp err namestring)))))
    650          
     663
     664#+windows-target
     665(defun %utimes (namestring)
     666  (with-filename-cstrs ((cnamestring namestring))
     667    (let* ((handle (#_CreateFileW
     668                    cnamestring
     669                    #$FILE_WRITE_ATTRIBUTES
     670                    (logior #$FILE_SHARE_READ #$FILE_SHARE_WRITE)
     671                    (%null-ptr)
     672                    #$OPEN_EXISTING
     673                    #$FILE_ATTRIBUTE_NORMAL
     674                    (%null-ptr))))
     675      (if (eql handle *windows-invalid-handle*)
     676        (%windows-error-disp (#_GetLastError))
     677        (rlet ((st #>SYSTEMTIME)
     678               (ft #>FILETIME))
     679          (#_GetSystemTime st)
     680          (#_SystemTimeToFileTime st ft)
     681          (let* ((result (#_SetFileTime handle (%null-ptr) (%null-ptr) ft))
     682                 (err (unless (eql 0 result) (#_GetLastError))))
     683            (#_CloseHandle handle)
     684            (if err
     685              (%windows-error-disp err)
     686              t)))))))
     687
     688
     689             
    651690
    652691#-windows-target
     
    15341573(defun run-external-process (proc in-fd out-fd error-fd &optional env)
    15351574  (let* ((args (external-process-args proc))
    1536          (child-pid (exec-with-io-redirection in-fd out-fd error-fd args proc)))
     1575         (child-pid (exec-with-io-redirection in-fd out-fd error-fd args proc env)))
    15371576    (when child-pid
    15381577      (setf (external-process-pid proc) child-pid)
     
    15441583  (reduce (lambda (left right) (concatenate 'string left " " right)) strings))
    15451584
    1546 (defun exec-with-io-redirection (new-in new-out new-err args proc)
     1585(defun exec-with-io-redirection (new-in new-out new-err args proc &optional env)
     1586  (declare (ignore env))                ; until we can do better.
    15471587  (with-filename-cstrs ((command (join-strings args)))
    15481588    (rletz ((proc-info #>PROCESS_INFORMATION)
Note: See TracChangeset for help on using the changeset viewer.