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.96 date: 2018/05/25 07:44:00
user: cg
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.1.0.0; WebServer 1.663 at exept.de:8081; Sun, 22 Jul 2018 06:39:26 GMT