2.4 Entries Collection

Represents the collection of Entry objects (files and directories) on a NetWare file system.

2.4.1 AddElement method

Creates a directory.

Syntax

Object.AddElement(
   DirName As String)

Parameters

DirName

The name of the directory to be created. The path can be either the path relative to the current working directory, or the full path.

Return Values

Entry.

Remarks

If the Web-based script is not authenticated to eDirectory with appropriate rights, an error is returned.

Example

This example creates the directory Philbin.

Set filemgr = Createobject("ucx:NWFileMgr") 
Set currentDir=filemgr.CurrentDir 
Set entries = currentDir.GetChildren() 
entries.AddElement("Philbin")

2.4.2 Element method

Finds a file or directory by name.

Syntax

Object.Element(
   EntryName As String)

Parameters

EntryName

The name of the file or directory to be found.

Return Values

Entry. Returns the specified Entry object. If the object is not available this method returns NULL value.

Remarks

EntryName can be either the name of a file or the name of a directory.

Example

This example finds the file jetson.bas.

Set filemgr = Createobject("ucx:NWFileMgr") 
Set currentDir=filemgr.CurrentDir 
Set entries = currentDir.GetChildren() 
Set entry = entries.Element("jetson.bas") 
Print entry.Name

2.4.3 HasMoreElements method

Determines whether the collection contains any more Entry objects.

Syntax

Object.HasMoreElements()

Parameters

None.

Return Values

Boolean. Returns TRUE if the collection contains more Entry objects.

Example

See sample in Example.

2.4.4 Next method

Returns the next Entry object in the Entries collection.

Syntax

Object.Next()

Parameters

None.

Return Values

Entry object. Returns the next Entry object in the collection. If there are no objects in the collection this method returns NULL.

Example

See sample in Example.

2.4.5 RemoveElement method

Deletes the specified Entry object from the collection.

Syntax

Object.RemoveElement(
   EntryName As String)

Parameters

EntryName

The name of the file or directory to be deleted.

Return Values

Boolean. Returns TRUE if the Entry object is successfully removed.

Remarks

The entryName parameter can be either the name of a file or the name of a directory.

If the Web-based script is not authenticated to eDirectory with appropriate rights, an error is returned.

Example

This example removes the file Philbin from the collection.

set filemgr = Createobject("ucx:NWFileMgr") 
set currentDir=filemgr.CurrentDir 
set entries = currentDir.getChildren() 
If entries.RemoveElement("Philbin") Then
  Print("Object deleted successfully")
Else
  Print("Unable to delete the object")
End If

2.4.6 Reset method

Resets the collection of Entry objects.

Syntax

Object.Reset()

Parameters

None.

Return Values

Void.

Remarks

This method is the first operation that starts the iteration over files and directories.

Example

This example resets the collection of Entry objects.

Set filemgr = Createobject("ucx:NWFileMgr") 
Set currentDir=filemgr.CurrentDir 
Set entries = currentDir.GetChildren() 
entries.Reset() 
While(entries.HasMoreElements) 
     Set entry = entries.Next()
     Print(entry.Name) 
Wend