Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

JScript File Object

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

Methods: JScript File Object

JScript File Object OpenAsTextStream Method

Opens a file and returns a TextStream object.

JScript File Object Copy Method

Copies a file from one location to another.

JScript File Object Delete Method

Deletes a file.

JScript File Object Move Method

Moves a file from one location to another.

Properties: JScript File Object

JScript File Object Attributes Property

The file system attributes of a file.

JScript File Object DateCreated Property

The date and time that a file was created.

JScript File Object DateLastAccessed Property

The date and time that a file was last accessed.

JScript File Object DateLastModified Property

The date and time that a file was last modified.

JScript File Object Drive Property

The drive letter of the drive on which the file resides. On UNIX, this property is always '/'.

JScript File Object Name Property

The name of a file.

JScript File Object ParentFolder Property

The Folder object containing the file.

JScript File Object Path Property

The file system path for the file.

JScript File Object ShortName Property

The short name used by programs that require 8.3 file names. This property is not currently supported on UNIX.

JScript File Object ShortPath Property

The short path used by programs that require 8.3 file names. This property is not currently supported on UNIX.

JScript File Object Size Property

The size, in bytes, of a file.

JScript File Object Type Property

Information about the type of a file. This property is not currently supported on UNIX.

Remarks: JScript File Object

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 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.