|
Class: DirectoryStream
Object
|
+--Stream
|
+--PeekableStream
|
+--PositionableStream
|
+--WriteStream
|
+--ReadWriteStream
|
+--ExternalStream
|
+--FileStream
|
+--DirectoryStream
- Package:
- stx:libbasic
- Category:
- Streams-External
- Version:
- rev:
1.116
date: 2023/09/26 13:57:07
- user: stefan
- file: DirectoryStream.st directory: libbasic
- module: stx stc-classLibrary: libbasic
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.
copyrightCOPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
instance creation
-
directoryNamed: dirName
-
return a DirectoryStream for directory named dirName, aString
Raises an openError, if the directory does not exist.
Usage example(s):
self directoryNamed:'adadasd'
self directoryNamed:'.'
|
access-reading
-
binary
-
intentionally ignored
-
contents
-
answer all of the directory entries as an OrderedCollection
Usage example(s):
|s|
s:= self directoryNamed:'.'.
s contents inspect.
s close.
|
-
nextLine
-
return the next filename as a string.
If atEnd: if signalAtEnd is true, raise and EndOfStreamError,
otherwise return nil
-
nextLineOrNil
-
return the next filename as a string or nil
-
nextLinkInfo
-
return the next FileStatusInfo or nil
-
text
-
intentionally ignored
initialization
-
initialize
-
instance release
-
closeFile
-
low level close of a directoryStream
private
-
openForReading
-
open the directory readonly
-
reOpen
-
USERS WILL NEVER INVOKE THIS METHOD
sent after snapin to reopen streams.
queries
-
atEnd
-
return true, if position is at end
testing
-
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:'c:\') isEmpty
(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
|
|