API:DirectoryStream::next
From Spherical
The DirectoryStream::next() method reads the next directory entry from a directory stream.
Usage
dir_entry = dirstream_obj.next();
API Information
Description
DirectoryStream::next() reads the next directory entry from the stream and advances the stream position. The value of DirectoryStream::position determines which entry is read.
Parameters
This method has no parameters.
Return Value
An object with two properties, .done and .value, with semantics compatible with the ES2015 iterator protocol. If there are no more entries to retrieve, .done is true and .value is undefined. Otherwise, .done is false and .value is an object describing the directory entry:
Property Type Description .fileName string The name of the file or directory, e.g. pig.js. If the entry is a directory, .fileName will end in a slash (/). .fullPath string The full SphereFS pathname of the file or directory, e.g. @/scripts/pig.js. .isDirectory boolean true if the entry is a directory, otherwise false.
See Also