eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DirectoryStream':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: DirectoryStream


Inheritance:

   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

Description:


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.


Related information:

    Filename

Class protocol:

instance creation
o  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:'.'


Instance protocol:

access-reading
o  contents
answer all of the directory entries as an OrderedCollection

o  nextLine
return the next filename as a string or nil

o  nextLinkInfo
return the next FileStatusInfo or nil

instance release
o  protected closeFile
low level close of a directoryStream

private
o  openForReading
open the file for readonly

o  reOpen
USERS WILL NEVER INVOKE THIS METHOD
sent after snapin to reopen streams.

testing
o  atEnd
return true, if position is at end

o  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

o  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



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 18 Apr 2024 23:43:03 GMT