File Manipulations (FSO)  
********************************************
Free JavaScript provided by ©2004-VB'Breizh
**Updated (06/22/2004)    Compatibility : 

Thanks to Didier and Aurelien asp-php.net
Relative topics : List (FSO : drives, dirs, subdirs, files...)
ERROR 429 ?
***"Activex component can't create object"
-Menu Tools...Internet Options ...Security...Personnalize...ActiveX Controls
-Check options [ActiveX-"Ask"]
***"Un composant Activex ne peut créer un objet"
-Menu Outils...Options Internet...Sécurité...Personnaliser le niveau...Contrôles ActiveX
-Cochez les cases [ActiveX-"Demander"]
***The Microsoft Scripting Runtime must be installed on your system.
The MS Windows Script components are installed by a self-extracting EXE.
This file can be downloaded at the following Microsoft Web site : MSDN
scr56en.exe (components for win98, 663 bytes)
=========== FileSystemObject Class : ===========
The FSO (FileSystemObject) class is a Microsoft ActiveX library.
This class provides access to the file system on a computer.
Methods : CreateTextFile, OpenTextFile, and GetFile.
 -CreateTextFile : creates a file and returns a TextStream object used for writing.
 -OpenTextFile : opens an existing file, used for reading and appending.
 -GetFile : returns a File object, which is a reference to an existing file.

================== File Class : ==================
Methods : Copy, Delete, Move, OpenAsTextStream
 -Copy(sSource, sDestination, bOverwrite?)
 -Delete() : removes the file
 -Move(sSource, sDestination)
 -OpenAsTextStream(k) :
      ForReading, (k=1)...read only
      ForWriting, (k=8)...write
      ForAppending, (k=2)...overwrite
Properties :
 -Attributes : refers to the file attributes
 -DateCreated : returns the file's creation date
 -DateLastAccessed : returns the file's last-accessed date
 -DateLastModified : returns the file's last-modified date
 -Drive : returns the file's letter drive
 -Name : returns the file name
 -ParentFolder : returns the file's parent folder name
 -Path : returns the file's long path
 -ShortName : returns the file's short name
 -ShortPath : returns the file's short path
 -Size : returns the file size
 -Type : returns the file type

============== TextStream Class : ==============
Methods : ReadAll, ReadLine, Read, Write, WriteLine, and Close.
 -ReadAll : returns a string representing a line from a file.
 -ReadLine(x) : returns the x line from a file.
 -Read(x) : returns the first x characters from a file.
 -Write(strMessage) : writes a string to a file. Overwrite the old string.
 -WriteLine(strMessage) : adds a string to a file. A new line is created.
 -WriteBlankLines() : adds blank lines.
 -Close : flushes the buffers and closes the TextStream.

=========== Usefull string functions : ===========
 -AtEndOfLine : returns true when the line has been read from a file.
 -AtEndOfStream : returns true when all lines have been read from a file.
 -FileExists(sFile) : returns true or false.
 -GetExtensionName(sFile) : returns the file extension.
 -Skip(x) : deletes the first x characters from a file.
 -SkipLine(x) : deletes the first x lines from a file.
 -InStr(x)
 -Trim(x)

  File manipulations (create, add, read...) :

          

...Copy the JavaScript source code below :


Comment, question ?