Microsoft KB Archive/189751

From BetaArchive Wiki
Knowledge Base


Article ID: 189751

Article Last Modified on 5/13/2003



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



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.

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.


REFERENCES

For additional information, please see the following articles in the Microsoft Knowledge Base:

185476 : HOWTO: Search Directories to Find or List Files

185601 : HOWTO: Recursively Search Directories Using FileSystemObject

186118 : HOWTO: Use FileSystemObject with Visual Basic



Additional query words: kbDSupport kbDSD kbVBp500 kbVBp kbNoKeyWord kbCtrl kbVBp600

Keywords: kbinfo KB189751