Author: Gan Jiping;
FSO does have some weaknesses - for example, it is difficult to handle binary files, which include Word documents, files in many graphic formats, and some other files. However, you can still manipulate these files in other ways - move them, delete them, etc. All you can't do is open or write them.
Another limitation is the problem of file length. When some content is read and written immediately, all the information is stored in memory - the more content, the more memory it consumes. This will slow down every job. Therefore, if you need to operate very large files, or large numbers of small files, consider dividing the files into small pieces and clearing the memory frequently. Incorporating applications into COM object components can also greatly improve the speed of the program.
Similarly, you cannot use FSO to manage permissions and file and folder properties. A good way to perform secure encryption is to set the aforementioned guest book file to read-only, set it to writeable when needed, and then modify it back. This method is often used in CGI and Perl, but unfortunately, there is no satisfactory way to implement it with FSO.
What else can I do with FSO?
There are many great features in FSO, but many people don't realize it. These functions are often discovered after you feel it is difficult to do something. At this time, you often sigh: If only I had known this method!
Here are some of these incommon but very cool features:
FSO features that are rarely understood
GetSpecialFolder Method Returns the path to a specific Windows folder: Windows installation directory; Windows system directory; Windows temporary directory ([0, 1, or 2])
GetTempName Method Returns a randomly generated file or directory name for when temporary data is required
GetAbsolutePathName Method Returns the absolute path to the folder (similar to).
For example, ("region") will return a result similar to the following: "c:mydocsmyfolder egg"
GetExtensionName Method Returns the extension of the last part of the path
(For example: ("c:docs") will return txt)
GetBaseName and GetParentFolder Methods Returns the parent folder of the last part of the path
(For example: ("c:docsmydocs") will return 'docs')
Drives Property Returns a collection of all locally available drives for building resource browser-like user interfaces.
When using the above functions, it is best to create a code for error handling. Because if the required parameters do not exist, troublesome information will be generated.
Summarize
As we have seen, FSO is very useful, and what we are introducing here is just the tip of the iceberg. You can use FSO to build powerful applications and simply complete many tasks.
FSO does have some weaknesses - for example, it is difficult to handle binary files, which include Word documents, files in many graphic formats, and some other files. However, you can still manipulate these files in other ways - move them, delete them, etc. All you can't do is open or write them.
Another limitation is the problem of file length. When some content is read and written immediately, all the information is stored in memory - the more content, the more memory it consumes. This will slow down every job. Therefore, if you need to operate very large files, or large numbers of small files, consider dividing the files into small pieces and clearing the memory frequently. Incorporating applications into COM object components can also greatly improve the speed of the program.
Similarly, you cannot use FSO to manage permissions and file and folder properties. A good way to perform secure encryption is to set the aforementioned guest book file to read-only, set it to writeable when needed, and then modify it back. This method is often used in CGI and Perl, but unfortunately, there is no satisfactory way to implement it with FSO.
What else can I do with FSO?
There are many great features in FSO, but many people don't realize it. These functions are often discovered after you feel it is difficult to do something. At this time, you often sigh: If only I had known this method!
Here are some of these incommon but very cool features:
FSO features that are rarely understood
GetSpecialFolder Method Returns the path to a specific Windows folder: Windows installation directory; Windows system directory; Windows temporary directory ([0, 1, or 2])
GetTempName Method Returns a randomly generated file or directory name for when temporary data is required
GetAbsolutePathName Method Returns the absolute path to the folder (similar to).
For example, ("region") will return a result similar to the following: "c:mydocsmyfolder egg"
GetExtensionName Method Returns the extension of the last part of the path
(For example: ("c:docs") will return txt)
GetBaseName and GetParentFolder Methods Returns the parent folder of the last part of the path
(For example: ("c:docsmydocs") will return 'docs')
Drives Property Returns a collection of all locally available drives for building resource browser-like user interfaces.
When using the above functions, it is best to create a code for error handling. Because if the required parameters do not exist, troublesome information will be generated.
Summarize
As we have seen, FSO is very useful, and what we are introducing here is just the tip of the iceberg. You can use FSO to build powerful applications and simply complete many tasks.