Represents the collection of files and subdirectories in a particular directory.
The following methods return an Entry object:
Creates a directory on the server.
object.AddElement(
dirName As String)
Entry.
This example creates the directory SAMPLES.
set dosfm = CreateObject("ucx:DosFileMgr")
set Entry = dosfm.FindEntry("c:\user")
set Entries = Entry.GetChildren("*.*",DIR_OPT_FILES)
Entries.AddElement("SAMPLES")
Finds a file or directory by name.
object.Element(
entryName As String)
Entry. Returns the specified Entry object if present; otherwise, NULL.
The parameter, entryName, can be either the name of a file or the name of a directory.
This example finds the file test.c.
set dosfm = CreateObject("ucx:DosFileMgr")
set Entry = dosfm.FindEntry("c:\user")
set Entries = Entry.GetChildren("*.*",DIR_OPT_FILES)
set Entry1 = Entries.Element("test.c")
Determines whether or not any more Entry objects exist in the collection based on the specified path.
object.HasMoreElements(
Path As String)
Boolean. Returns TRUE if the collection contains more Entry objects. otherwise, FALSE.
This example determines whether more Entry objects exist in the collection.
set dosfm = CreateObject("ucx:DosFileMgr")
set Entry = dosfm.FindEntry("c:\user")
set Entries = Entry.GetChildren("*.*",DIR_OPT_FILES)
Entries.Reset
while(Entries.HasMoreElements = TRUE)
set Entry1 = Entries.Next ()
print("Name of the file is:" & Entry1.Name)
wend
Returns the next Entry object in the Entries collection.
object.Next()
None.
Entry. Returns the next Entry object in the Entries collection.
This example returns the next Entry object in the collection.
set dosfm = CreateObject("ucx:DosFileMgr")
set Entry = dosfm.FindEntry("c:\user")
set Entries = Entry.GetChildren("*.*",DIR_OPT_FILES)
Entries.Reset()
while(Entries.HasMoreElements = TRUE)
set Entry1 = Entries.Next()
print("Name of the file is:" & Entry1.Name)
wend
Deletes the specified Entry object.
object.RemoveElement(
entryName As String)
Boolean. Returns TRUE if the Entry object is successfully removed. otherwise, FALSE.
The entryName parameter can be either the name of a file or the name of a directory.
This example removes the file samples.c from the collection.
set dosfm = CreateObject("ucx:DosFileMgr")
set Entry = dosfm.FindEntry("c:\user")
set Entries = Entry.GetChildren("*.*",DIR_OPT_FILES)
Entries.RemoveElement("samples.c")
Resets the collection of entries.
object.Reset()
None.
Void.
This example resets the collection of entries.
set dosfm = CreateObject("ucx:DosFileMgr")
set Entry = dosfm.FindEntry("c:\user")
set Entries = Entry.GetChildren("*.*",DIR_OPT_FILES)
Entries.Reset
while(Entries.HasMoreElements = TRUE)
set Entry1 = Entries.Next
print("Name of the file is:" & Entry1.Name)
wend