ClassPath: MEng.System.Runtime.FileSystem Parent ClassPath: MEng.Object Copyable: No Final: Yes This class provides the standard sorts of file system operations that you would expect to have, such as checking for the existence of directories or files, getting information about them, getting lists of files or directories, delete files, or create and remove subdirectories.
Nested Classes:
Enum=FileSysErrors CopyFailed : ""; CreateFailed : ""; DeleteFailed : ""; FileSysErr : ""; OpenFailed : "Could not open file '%(1)'"; PathNotFound : "Path '%(1)' was not found"; PathNotFQ : "The passed path must be fully qualified"; SearchFailed : ""; EndEnum;This enumerated type defines some common file system errors that are thrown by this class and other file related classes, such as file based input or output streams. Some of them have no text because it will just be set to the text of the underlying C++ error that is really being reported.
VectorOf[String] PathList;There are methods to return a list of directories or files in a given scope. So they need to return a list of strings that hold the paths. Any vector of strings can be used, but we just need one here in order to insure that there's one to define the interface in terms of.
Constructors:
Constructor();Their is only a default constructor available.
Final, Const Methods:
DirExists([In] MEng.String ToCheck, [In] MEng.Boolean NormalOnly) Returns MEng.Boolean;Checks to see if ToCheck is a valid existing directory. NormalOnly indicates whether you only want to check for 'normal' directories, which would mean ignoring things like "." and ".."and hidden directories.
FileExists([In] MEng.String ToCheck, [In] MEng.Boolean NormalOnly) Returns MEng.Boolean;Checks to see if ToCheck is a valid existing file. NormalOnly indicates whether you only want to check for 'normal' files, which would mean ignoring files other than normally visible files, not ones that are hidden or are considered system files.
FindDirs ( [In] MEng.String ParentDir , [In] MEng.String Wildcard , [In] MEng.Boolean NormalOnly , [Out] PathList ToFill ) Returns MEng.Boolean; FindFiles ( [In] MEng.String ParentDir , [In] MEng.String Wildcard , [In] MEng.Boolean NormalOnly , [Out] PathList ToFill ) Returns MEng.Boolean;Searches the indicated parent directory for any subdirectories or files that match the passed wildcard, use "*" for all. You can indicate you only want to see 'normal' entries, i.e. you will not see hidden directories or files or the special . or .. directories. This is usually what you want.
HasWildcards([In] MEng.String ToCheck) Returns MEng.Boolean;Checks the passed file path to see if it contains any wild cards. If so, it's not a valid path that can be opened.
Final, Non-Const Methods:
CopyFile([In] MEng.String SrcPath, [In] MEng.String TarPath);Copies the file at source path to the new target path. The file must not be opened by any applications or it cannot move and the FileSysErrors.CopyFailed exception will be thrown.
DelFile([In] MEng.String FilePath);Deletes the indicated file. The file must not be opened by any applications or it cannot move and the FileSysErrors.DeleteFailed exception will be thrown.
MakePath([In] MEng.String FilePath);Creates the passed path. It will step through the components of the path, creating all of the subdirectories required to create the full path. If any of the path already exists, it will just move down through them and start work at the first component that does not exist. If the path cannot be created for some reason, the FileSysErrors.CreateFailed exception will be thrown.
MakeSubDir([In] MEng.String ParentDir, [In] MEng.String ToCreate);Creates a single subdirectory under an existing directory. The new subdirectory should not exist and an exception will be thrown, so check first using DirExists(). If the creation fails, the FileSysErrors.CreateFailed exception will be thrown.