Previous PageNext Page

7.15 File Object

The File object provides access to all the properties of a file.
 

Methods

OpenAsTextStream
 
Opens a file and returns a TextStream object.
 
Copy
 
Copies a file from on location to another.
 
Delete
 
Deletes a file.
 
Move
 
Moves a file from one location to another.
 

Properties

Attributes
 
The file system attributes of a file.
 
DateCreated
 
The date and time that a file was created.
 
DateLastAccessed
 
The date and time that a file was last accessed.
 
DateLastModified
 
The date and time that a file was last modified.
 
Drive
 
The drive letter of the drive on which the file resides. On UNIX, this property is always `/'.
 
Name
 
The name of a file.
 
ParentFolder
 
The Folder object containing the file.
 
Path
 
The file system path for the file.
 
ShortName
 
The short name used by programs that require 8.3 file names. This property is not currently supported on UNIX.
 
ShortPath
 
The short path used by programs that require 8.3 file names. This property is not currently supported on UNIX.
 
Size
 
The size, in bytes, of a file.
 
Type
 
Information about the type of a file. This property is not currently supported on UNIX.
 

Remarks

The following code illustrates how to obtain a File object and how to view one of its properties.
 

function ShowFileInfo(filespec)

{

var fs, file, s;

fs = new ActiveXObject("Scripting.FileSystemObject");

file = fs.GetFile(filespec);

s = file.DateCreated;

Response.Write(s);

}


Copyright © 2000 Chili!Soft

Previous PageTop Of PageNext Page