diff --git a/Interfaces/IReadOnlyFilesystem.cs b/Interfaces/IReadOnlyFilesystem.cs index 21ab419af..b16c447d7 100644 --- a/Interfaces/IReadOnlyFilesystem.cs +++ b/Interfaces/IReadOnlyFilesystem.cs @@ -125,4 +125,26 @@ public interface IReadOnlyFilesystem : IFilesystem /// Link path. /// Link destination. ErrorNumber ReadLink(string path, out string dest); + + /// Opens a file for reading. + /// Path to the file. + /// Represents the opened file and is needed for other file-related operations. + /// Error number + ErrorNumber OpenFile(string path, out IFileNode node); + + /// Closes an file, freeing any private data allocated on opening. + /// The file node. + /// Error number. + ErrorNumber CloseFile(IFileNode node); +} + +/// Represents an opened file from a filesystem +public interface IFileNode +{ + /// Path to the file + string Path { get; } + /// File length + long Length { get; } + /// Current position in file + long Offset { get; } } \ No newline at end of file