FileSystemObject

Question and Answers on File System Object Model
1) What is Computer File System?

It is a feature of Operating System it allows to work with drives, folders and files

Every OS has file system, Windows OS having FAT (File allocation table) and NTFS (New technology File system).

2) Give examples for File System Operations?

Create a Folder,

Copy a Folder,

Delete a Folder,

Create a Text File,

Copy a Text File,

Delete a Text File,

Read Data,

Write Data,

Compare Data,

Search operations
Etc…

3) How end user performs File System Operations?

End User Performs File System Operations manually with the help of Mouse and Keyboard like input devices.

4) How to perform automatic File System Operations using VBScript?

Using FileSystemObject we can perform File System Operations

5) How to create File System Object?

Set Variable = CreateObject(“Scripting.FileSystemObject”)

(Set is VBScript Statement, CreateObject is built in function of VBScript, “Scripting.FileSystemObject” is class value)

6) What is Text Stream Object?

It is sub object of FileSystemObject, used to perform text related operations

7) What is Text Related Operations?

Reading
    Char by Char
    Line by Line
    Read All

Writing
    Continuously
    Line by Line
    Appending

Comparing
    by Size (*External Operation)
    by Text
    by Binary Values / ANSI Char codes

Search Operations Etc…

8) How to create Text Stream Object?

Set variable = Filesystemobject.CreateTextFile / OpenTextFile (“Path”)

9) Can we create Excel, Word and PDF files using FileSystemObject?

Yes we can, but FileSystemObject treats them as flat files

10) What is Flat file?

File which doesn’t have format, Ex: Notepad

11) What are the File modes in File System Object Model?

1 for Read, 2 for Write and 8 for Append
12) What is the default file mode in  File System Object Model?
Read is the default File mode in File System Object Model.
13) What is Folder Object?
It is a sub object of FileSystemObject, used to perform operations on Folders
14) What is Drive Object?
It is also a sub object of FileSystemObject, used to perform operations on Drives.
15) How to release the memory that used for Objects?
Set Object = Nothing
16) Give some examples for external operations in File System Object Model? 
Examples for High Level  or External Operations

Create a Folder,

Copy a Folder,

Delete a Folder,

Create a Text File,

Copy a Text File,

Delete a Text file,

Check the existence of a Text File,

Check size of a File,
Etc…
17) Give some examples for Internal operations in File System Object Model?
Reading
Character by Character
    Line by Line
Read All

Writing
Continuously
    Line by Line
Appending

Comparing
by Text
by Binary Values / ANSI Char codes

Search Operations Etc…

18) What is the difference between Write and Append file modes?
Write mode overwrite the data every time
Append mode adds the data.
————————————————-

 

Comments