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

 

JScript FileSystemObject Object

The FileSystemObject provides access to a computer's file system.

Methods: JScript FileSystemObject Object

JScript FileSystemObject Object BuildPath Method

Appends a name to an existing path.

JScript FileSystemObject Object CopyFile Method

Copies one or more files from one location to another.

JScript FileSystemObject Object CopyFolder Method

Copies one or more folders and their contents from one location to another.

JScript FileSystemObject Object CreateFolder Method

Creates a folder

JScript FileSystemObject Object CreateTextFile Method

Creates a text file with a specified name and returns a TextStream object.

JScript FileSystemObject Object DeleteFile Method

Deletes a specified file.

JScript FileSystemObject Object DeleteFolder Method

Deletes a specified folder and its contents.

JScript FileSystemObject Object DriveExists Method

Returns a Boolean value indicating the existence of a drive.

JScript FileSystemObject Object FileExists Method

Returns a Boolean value indicating the existence of a file.

JScript FileSystemObject Object FolderExists Method

Returns a Boolean value indicating the existence of a folder.

JScript FileSystemObject Object GetAbsolutepathname Method

Returns a complete and unambiguous path from a provided path specification.

JScript FileSystemObject Object GetBaseName Method

Returns a string containing the base name of the last component, less any extension, in a path.

JScript FileSystemObject Object GetDrive Method

Returns a Drive object corresponding to the drive in a specified path.

JScript FileSystemObject Object GetDriveName Method

Returns a string containing the name of a drive for a specified path.

JScript FileSystemObject Object GetExtensionName Method

Returns a string containing the extension name for the last component in a path.

JScript FileSystemObject Object GetFile Method

Returns a File object corresponding to the file in a specified path.

JScript FileSystemObject Object GetFileName Method

Returns the last component of the specified path that is not part of the drive specification.

JScript FileSystemObject Object GetFolder Method

Returns a Folder object corresponding to the folder in a specified path.

JScript FileSystemObject Object GetParentFolderName Method

Returns a string containing the name of the parent folder of the last component in a specified path.

JScript FileSystemObject Object GetSpecialFolder Method

Returns the special folder specified.

JScript FileSystemObject Object GetTempName Method

Returns a randomly generated temporary file or folder name.

JScript FileSystemObject Object MoveFile Method

Moves one or more files from one location to another.

JScript FileSystemObject Object MoveFolder Method

Moves one or more folders and their contents from one location to another.

JScript FileSystemObject Object OpenTextFile Method

Opens a specified file and returns a TextStream object.

Properties: JScript FileSystemObject Object

JScript FileSystemObject Object Drives Property

A collection of all Drive objects available on the local machine. See the Drives collection section.

 

Note

Collections returned by FileSystemObject method calls reflect the state of the file system when the collection was created. Changes to the file system after creation are not reflected in the collection. If the file system might be changed during the lifetime of the collection object, the method returning the collection should be called again to ensure that the contents are current.

Remarks: JScript FileSystemObject Object

The following code illustrates how the FileSystemObject is used to return a TextStream object that can be read from or written to:

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

var a = fs.CreateTextFile("c:\testfile.txt", true);

a.WriteLine("This is a test.");

a.Close();

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.