Changeset 8066 in project


Ignore:
Timestamp:
02/02/08 18:01:27 (12 years ago)
Author:
sjamaan
Message:

Implement 9p:delete-file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/9p/trunk/9p-client.scm

    r8065 r8066  
    172172(define (9p:file-open con name mode)
    173173  (let* ((h (9p:path-walk con name))
    174          (response (9p:request (9p:handle-connection h) 'Topen (9p:handle-fid h) mode))
     174         (response (9p:request con 'Topen (9p:handle-fid h) mode))
    175175         (iounit (second (9p:message-contents response))))
    176176    (9p:initialize-iounit! h iounit)
     
    339339                       (make-property-condition 'exn 'message (sprintf "~S is not a directory!" file))
    340340                       (make-property-condition 'file)))
    341               (let* ((response (9p:request (9p:handle-connection h) 'Topen (9p:handle-fid h) 9p:open/rdonly))
     341              (let* ((response (9p:request con 'Topen (9p:handle-fid h) 9p:open/rdonly))
    342342                     (iounit (second (9p:message-contents response))))
    343343                (9p:initialize-iounit! h iounit)
    344344                (9p:read-directory h show-dotfiles?)))))))))
    345345
    346 ;; NEXT UP: 9P:DELETE-FILE, then 9P:RENAME-FILE
     346(define (9p:delete-file con path)
     347  (let ((h (9p:path-walk con path)))
     348    (handle-exceptions exn (begin (9p:release-handle h) (signal exn))
     349      (9p:request con 'Tremove (9p:handle-fid h)) (9p:release-handle h))))
     350
     351;; TODO: 9p:rename-file
    347352
    348353(define (9p:read-directory h show-dotfiles?)
Note: See TracChangeset for help on using the changeset viewer.