Changeset 11059 for trunk/source/level-1/l1-sysio.lisp
- Timestamp:
- Oct 12, 2008, 8:07:56 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/level-1/l1-sysio.lisp
r9869 r11059 18 18 19 19 (defstruct (file-ioblock (:include ioblock)) 20 (octet-pos 0 :type fixnum); current io position in octets21 (fileeof 0 :type fixnum); file length in elements20 (octet-pos 0 ) ; current io position in octets 21 (fileeof 0 ) ; file length in elements 22 22 ) 23 23 … … 590 590 (defmethod stream-length ((stream fundamental-file-input-stream) &optional newlen) 591 591 (with-stream-ioblock-input (file-ioblock stream :speedy t) 592 (%ioblock-input-file-length file-ioblock newlen))) 592 (let* ((res (%ioblock-input-file-length file-ioblock newlen))) 593 (and res (>= res 0) res)))) 594 593 595 594 596 (defmethod stream-length ((stream basic-file-input-stream) &optional newlen) 595 597 (let* ((file-ioblock (basic-stream-ioblock stream))) 596 598 (with-ioblock-input-locked (file-ioblock) 597 (%ioblock-input-file-length file-ioblock newlen)))) 599 (let* ((res (%ioblock-input-file-length file-ioblock newlen))) 600 (and res (>= res 0) res))))) 598 601 599 602 600 603 (defmethod stream-length ((s fundamental-file-output-stream) &optional newlen) 601 604 (with-stream-ioblock-output (file-ioblock s :speedy t) 602 (%ioblock-output-file-length file-ioblock newlen))) 605 (let* ((res (%ioblock-output-file-length file-ioblock newlen))) 606 (and res (>= res 0) res)))) 603 607 604 608 … … 606 610 (let* ((file-ioblock (basic-stream-ioblock stream))) 607 611 (with-ioblock-output-locked (file-ioblock) 608 (%ioblock-output-file-length file-ioblock newlen)))) 612 (let* ((res (%ioblock-output-file-length file-ioblock newlen))) 613 (and res (>= res 0) res))))) 609 614 610 615 (defmethod stream-length ((s fundamental-file-io-stream) &optional newlen) 611 616 (with-stream-ioblock-input (file-ioblock s :speedy t) 612 (%ioblock-output-file-length file-ioblock newlen))) 617 (let* ((res (%ioblock-output-file-length file-ioblock newlen))) 618 (and res (>= res 0) res)))) 613 619 614 620 (defmethod stream-length ((stream basic-file-io-stream) &optional newlen) 615 621 (let* ((file-ioblock (basic-stream-ioblock stream))) 616 622 (with-ioblock-input-locked (file-ioblock) 617 (%ioblock-output-file-length file-ioblock newlen)))) 623 (let* ((res (%ioblock-output-file-length file-ioblock newlen))) 624 (and res (>= res 0) res))))) 618 625 619 626 (defun close-file-stream (s abort)
Note: See TracChangeset
for help on using the changeset viewer.