|
Class: DirectoryStream
Object
|
+--Stream
|
+--PeekableStream
|
+--PositionableStream
|
+--WriteStream
|
+--ReadWriteStream
|
+--ExternalStream
|
+--FileStream
|
+--DirectoryStream
- Package:
- stx:libbasic
- Category:
- Streams-External
- Version:
- rev:
1.99
date: 2019/08/13 15:52:51
- user: stefan
- file: DirectoryStream.st directory: libbasic
- module: stx stc-classLibrary: libbasic
- Author:
- Claus Gittinger
Instances of DirectoryStream allow reading a file-directory,
as if it was a stream of filenames.
Basically, its an interface to opendir, readdir and closedir.
Notice:
DirectoryStream is an ST/X special;
for portability, we recommend the use of Filename protocol.
Filename
instance creation
-
directoryNamed: dirName
-
return a DirectoryStream for directory named dirName, aString
Raises an openError, if the directory does not exists.
usage example(s):
self directoryNamed:'adadasd'
self directoryNamed:'.'
|
access-reading
-
contents
-
answer all of the directory entries as an OrderedCollection
-
nextLine
-
return the next filename as a string or nil
-
nextLinkInfo
-
return the next FileStatusInfo or nil
instance release
-
protected closeFile
-
low level close of a directoryStream
private
-
openForReading
-
open the file for readonly
-
reOpen
-
USERS WILL NEVER INVOKE THIS METHOD
sent after snapin to reopen streams.
testing
-
atEnd
-
return true, if position is at end
-
isEmpty
-
test for if the unread portion of the directory stream is empty.
This query changes the readPointer of the DirectoryStream
usage example(s):
(DirectoryStream directoryNamed:'/') isEmpty
(DirectoryStream directoryNamed:'/var/tmp') isEmpty
|
-
isOpen
-
return true, if this stream is open
usage example(s):
executors are only used to finalize - they are not really open and are closed with #closeFile,
which does not check for #isOpen
|
|