requires: {#Stream. #ExtensibleSequence}. provides: {#PathName. #FileStream}. prototypes addSlot: #PathName valued: Cloneable derive. PathName addSlot: #host. "The storage system or logical host of the file." PathName addSlot: #device. "The logical or physical device hosting the file. (optional)" PathName addSlot: #path valued: ExtensibleSequence newEmpty. "The Sequence of path accessors (directory names) to reach the file's area." PathName addSlot: #name valued: ''. "The name of a file(-group)." PathName addSlot: #type. "Corresponds to the filetype or suffix used in many filesystems." PathName addSlot: #version. "Corresponds to the version of a file, with optional support." FileStream traits addDelegate: #stream valued: ReadWriteStream traits. "FileStream addSlot: #rwmode." "Unused for now. All FileStreams are R/W. TODO: fix this." fs@(FileStream traits) contents "Get everything from the file at once, preserving the current position in the file." [| s pos | pos: fs position. fs position: 0. s: (fs next: fs size). fs position: pos. s ]. fs@(FileStream traits) next: n putInto: seq@(ExtensibleSequence traits) "A utility wrapper for ExtensibleSequences." [ n > (seq contents size - seq firstIndex) ifTrue: [^ (error: 'There is not enough space in the Sequence.')]. fs next: n putInto: seq contents startingAt: seq firstIndex ].