Represents a file or directory.
The following methods return an Entry object:
Sets or returns the attributes of a file or directory.
object.Attributes[=Attr As Integer]
Integer.
Read/write.
Attr is an optional parameter that sets
the attributes for the Entry object. See Attribute
Constants
.
This example returns the attributes of the file User.
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("Attributes of " & Entry1.Name & " are : " &Entry1.Attributes)
wend
Determines whether or not the Entry object is a directory.
object.Directory
Boolean.
Read-only.
This property returns TRUE if the Entry object is a directory.
This example returns TRUE if the object User is a directory.
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
if(Entry1.Directory = TRUE) then
print("Entry1.Name & " is a directory")
else
print("Entry1.Name & " is a file")
endif
wend
Sets or returns the date the entry was modified.
object.ModifyDate[=DateValue As Date]
Date.
Read/write.
Date is an optional parameter that sets the modification date for the file.
This example returns the date the file USER was modified.
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("Modification date of " & Entry1.Name & " is: "
Entry1.ModifyDate)
wend
Sets or returns the name of a file or directory.
object.Name
String.
Read/write.
Change the value of this property to rename the actual file or directory.
This example returns the name of the next file 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 size of the file.
object.Size
String.
Read-only.
If the object is a directory, this property returns 0 (zero).
This example returns the size of the file USER. If USER is a directory, this property returns 0.
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("Size of " & Entry1.Name & " is : " &Entry1.Size)
wend
Returns child entries of a directory.
object.GetChildren(
[NameFilter As String],
[TypeFilter As Integer])
Directory Entry Filter Constants. The default is DIR_OPT_ALL.
Entries. If the current object is a directory, this method returns its child entries; otherwise, NULL.
If the current object is a directory, this GetChildren example returns its child Entries. If it is not a directory, this example returns NULL
set dosfm = CreateObject("ucx:DosFileMgr")
set Entry = dosfm.FindEntry("c:\USER")
set Entries = Entry.GetChildren("*.*",DIR_OPT_FILES)
set Entry1 = Entries.Element("Test")
if(Entry1.Directory = TRUE) then
while(Entries.HasMoreElements = TRUE)
print("Entry1.Name & " is a directory")
else
print("Entry1.Name & " is a file")
endif