Help and Support
 

powered byLive Search

INFO: Limitations of the FileSystemObject

Article ID:189751
Last Review:May 13, 2003
Revision:3.0
This article was previously published under Q189751

SUMMARY

This article describes the limitations of the FileSystemObject stored in the Microsoft Scripting Runtime file, scrrun.dll. For more information about the FileSystemObject, see the appropriate topics in the Visual Basic documentation.

Back to the top

MORE INFORMATION

Reads only ASCII data - while the FileSystemObject can create an ASCII or Unicode text file, the FileSystemObject can only read ASCII text files.
Forward reading line-by-line - the FileSystemObject reads a text file in one direction: from the beginning to the end of the text file. Further, the FileSystemObject only reads line-by-line. If you need to go back to a previous line, then you must return to the beginning of the file and read forward to the required line.
Cannot open a file for simultaneous reading and writing - you can open a file for reading by using the ForReading IOMode parameter of the OpenTextFile method. However, if you want to modify the file, you must reopen the file for appending or writing and then open a textstream object to make your file modifications.
Cannot search for file names using wildcards - the FileSystemObject can only retrieve a specified file using the GetFile method. You cannot use wildcard characters in the filespec parameter of the GetFile method.
Cannot return the file version number - the File object in the Files collection of the FileSystemObject can return several file properties. However, there is no version property. Use the GetFileVersionInfo Windows API function to get a file's version information.
Cannot sort file names from the files collection - you can iterate through the File objects in the Files collection to obtain a list of the files in a folder. However, the File objects are not sorted. You need to use a sort routine to sort the File objects in the Files collection.

Back to the top

REFERENCES

For additional information, please see the following articles in the Microsoft Knowledge Base:
185476 (http://support.microsoft.com/kb/185476/EN-US/) : HOWTO: Search Directories to Find or List Files

185601 (http://support.microsoft.com/kb/185601/EN-US/) : HOWTO: Recursively Search Directories Using FileSystemObject

186118 (http://support.microsoft.com/kb/186118/EN-US/) : HOWTO: Use FileSystemObject with Visual Basic

Back to the top


APPLIES TO
Microsoft Visual Basic 5.0 Learning Edition
Microsoft Visual Basic 6.0 Learning Edition
Microsoft Visual Basic 5.0 Professional Edition
Microsoft Visual Basic 6.0 Professional Edition
Microsoft Visual Basic 5.0 Enterprise Edition
Microsoft Visual Basic 6.0 Enterprise Edition

Back to the top

Keywords: 
kbinfo KB189751

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by E-mail, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.