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.116 date: 2023/09/26 13:57:07
user: stefan
file: DirectoryStream.st directory: libbasic
module: stx stc-classLibrary: libbasic

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.

copyright

COPYRIGHT (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.

Class protocol:

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


Instance protocol:

access-reading
o  binary
intentionally ignored

o  contents
answer all of the directory entries as an OrderedCollection

Usage example(s):

        |s|
        s:= self directoryNamed:'.'.
        s contents inspect.
        s close.

o  nextLine
return the next filename as a string.
If atEnd: if signalAtEnd is true, raise and EndOfStreamError,
otherwise return nil

o  nextLineOrNil
return the next filename as a string or nil

o  nextLinkInfo
return the next FileStatusInfo or nil

o  text
intentionally ignored

initialization
o  initialize

instance release
o  closeFile
low level close of a directoryStream

private
o  openForReading
open the directory readonly

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

queries
o  atEnd
return true, if position is at end

testing
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:'c:\') isEmpty
        (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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 17:47:19 GMT