2.3 Entry Object

Represents a file or directory on a NetWare file system.

2.3.1 AccessDate property

Returns the date on which the file or directory was last accessed, or sets the access date for the object.

Syntax

Object.AccessDate[=DateValue As Date]

Type

Date.

Attributes

Read/write.

Remarks

DateValue is an optional parameter that sets the access date to the specified value.

Example

See sample in Example.

2.3.2 ArchiveDate property

Returns the date the file or directory was archived, or sets the object's archive date.

Syntax

Object.ArchiveDate[=DateValue As Date]

Type

Date.

Attributes

Read/write.

Remarks

DateValue is an optional parameter that sets the archive date to the specified value.

Example

See sample in Example.

2.3.3 Attributes property

Returns the attributes of a file or directory. Return value is one of the attribute constants.

Syntax

Object.Attributes

Type

Integer.

Attributes

Read/write.

Example

See sample in Example.

See Also

2.3.4 CreateDate property

Returns the creation date of the file or directory, or sets the object's creation date.

Syntax

Object.CreateDate[=DateValue As Date]

Type

Date.

Attributes

Read/write.

Remarks

DateValue is an optional parameter that sets the creation date to the specified value.

Example

See sample in Example.

2.3.5 Directory property

Determines whether the Entry object is a directory.

Syntax

Object.Directory

Type

Boolean. Returns TRUE if a specific object is a directory.

Attributes

Read-only.

Example

This example returns the message "dir.bas is a file" as the specified object dir.bas is a file.

Set filemgr = Createobject("ucx:NWFileMgr") 
Set entry = filemgr.FindEntry("Sys:NSN\util\dir.bas") 
If(entry.Directory) Then 
     Print(entry.Name & "is a directory") 
Else 
     Print(Entry.name & "is a file") 
End If

See Also

2.3.6 ModifyDate property

Returns the date on which the object was last modified, or sets the object's modification date.

Syntax

Object.ModifyDate[=DateValue As Date]

Type

Date.

Attributes

Read/write.

Remarks

DateValue is an optional parameter that sets the modification date to the specified value.

Example

See sample in Example.

2.3.7 Name property

Sets or returns the name of a object.

Syntax

Object.Name[=Value As String]

Type

String.

Attributes

Read/write.

Remarks

Value is an optional parameter that changes the name of the object.

Example

See sample in Example.

 

See Also

2.3.8 Owner property

Returns the owner of a file or directory.

Syntax

Object.Owner

Type

String.

Attributes

Read-only.

Example

See sample in Example.

 

See Also

2.3.9 Size property

Returns the size of a file.

Syntax

Object.Size

Type

Long.

Attributes

Read-only.

Remarks

If the object is a directory, this property returns 0 (zero).

Example

See sample in Example.

 

2.3.10 SpaceLimit Property

Returns the directory space restriction value in Kilo Bytes (KB).

Syntax

Object.SpaceLimit[=Value As Long]

Type

Long.

Attributes

Read-write.

Remarks

If there is no space restriction, this property returns zero.

To get or set this property in Web scripts, user should have rights equivalent to the administrator. Else, error will be thrown.

When this property is set, the space limit would be truncated to nearest 4 KB. For example if seventy seven (77) is assigned, the space limit will be set to seventy six (76) only.

If error is thrown, this property is set to -1.

Example

This sample sets the space limit for sys:\nsn\util directory.

On Error Resume Next
Set filemgr = CreateObject("ucx:NWFileMgr")

’ Set the space restriction for util directory to 80KB
’
Set entry = filemgr.FindEntry("sys:\nsn\util")
entry.spacelimit=80
Print "The space Limit for sys:\nsn\util directory is " &entry.spacelimit &"
KB"

2.3.11 Trustees property

Returns the Trustees of a file or directory.

Syntax

Object.Trustees

Type

Trustees.

Attributes

Read-only.

Example

This example returns the trustees, size, attributes, owner, name, last modified date, creation date, last archived date and last access date of the file dir.bas.

Set filemgr = Createobject("ucx:NWFileMgr") 
Set entry = filemgr.FindEntry("Sys:NSN\util\dir.bas") 
Print(entry.Trustees)
Print(entry.Size)
Print(entry.Owner)
Print(entry.Name)
Print(entry.Attributes)
Print(entry.ModifyDate)
Print(entry.CreateDate)
Print(entry.ArchiveDate)
Print(entry.AccessDate)

2.3.12 GetChildren method

Returns child entries of a directory.

Syntax

Object.GetChildren(
   [NameFilter As String], 
   [TypeFilter As Integer])

Parameters

NameFilter

Optional. Use this parameter to retrieve specific types of files or directories. Wildcards such as * and ? can be used. By default the NameFilter is set to *.

TypeFilter

Optional. Filters the entries in the directory. This parameter can have any of the Section A.9, Directory Entry Filter Constants. By default the TypeFilter is set to DIR_OPT_ALL.

Return Values

Entries. If the current object is a directory, this method returns its child entries. If it is a file, it returns NULL value.

Example

If the current object is a directory, this example returns its child Entries. If it is a file, this example returns NULL. The optional parameters of this method help in filtering the resulting entries.

Set filemgr = Createobject("ucx:NWFileMgr") 
Set entry = filemgr.FindEntry("Sys:NSN\util") 
Set entries = entry.GetChildren("*.*",DIR_OPT_FILES) 
entries.Reset()
While(entries.HasMoreElements()) 
     Set fileentry=entries.Next()
     Print(fileEntry.name) 
Wend

See Also