spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column71


Scripting the File System, Part I

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

The file Object

GetFile(pathName)Object

This method returns the file object of the given file name. The following script should create a file object for f:\yehuda\js\tips\myapps.txt:

<SCRIPT LANGUAGE="JavaScript">
<!--
var fso = new ActiveXObject("Scripting.FileSystemObject");
fileObj = fso.GetFile("f:\\yehuda\\js\\tips\\myapp.txt");
-->
</SCRIPT>

Here are the file object's properties:

PropertyDescription
AttributesRefers to the file attributes
DateCreatedReturns the file's creation date
DateLastAccessedReturns the file's last-accessed date
DateLastModifiedReturns the file's last-modified date
DriveReturns the file's letter drive
NameReturns the file name
ParentFolderReturns the file's parent folder name
PathReturns the file's long path
ShortPathReturns the file's short path
SizeReturns the file size
TypeReturns the file type

Here are the file object's methods:

MethodDescription
Copy()Copies the file from one folder to another
Delete()Removes the file
Move()Moves the file from one folder to another
OpenAsTextStream()Opens the file as a text stream

Next: How to use GetFolder()

http://www.internet.com


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: November 20, 2000
Revised: November 20, 2000

URL: http://www.webreference.com/js/column71/8.html