EngineGetFileSystemItemAsync Method |
Namespace: ITHit.FileSystem
This is a factory method that returns files and folders in your user file system. In your implementation you will return file or folder object that corresponds to provided path parameter. Your file must implement IFile interface. Your folder must implement IFolder interface.
The Engine will then call IFile and IFolder methods to get the required information and pass it to the platform.
Note that this method may be called for files that does not exist in the user file system, for example when a file handle is closed after the file has been deleted.
The code below is part of 'VirtualFileSystem' C# sample provided with the SDK.
public override async Task<IFileSystemItem> GetFileSystemItemAsync(string path) { if(File.Exists(path)) { return new VfsFile(path, this, this); } if(Directory.Exists(path)) { return new VfsFolder(path, this, this); } // When a file handle is being closed during delete, the file does not exist, return null. return null; }