mirror of
https://github.com/kwsch/pkNX.git
synced 2026-09-30 21:27:24 -05:00
Made VFS fully functional
Still need to start using it, but want to do it a bit slow to test it out. Also should really build some unit tests for this one..
This commit is contained in:
@@ -47,25 +47,28 @@ public bool Exists(FileSystemPath path)
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Stream OpenFile(FileSystemPath path, FileAccess access)
|
||||
public Stream OpenFile(FileSystemPath path, FileMode mode = FileMode.Open, FileAccess access = FileAccess.Read)
|
||||
{
|
||||
if (access != FileAccess.Read)
|
||||
throw new InvalidOperationException("This is a read-only filesystem.");
|
||||
return FileSystem.OpenFile(path, access);
|
||||
throw new UnauthorizedAccessException("This is a read-only filesystem.");
|
||||
return FileSystem.OpenFile(path, mode, access);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Stream CreateFile(FileSystemPath path)
|
||||
{
|
||||
throw new InvalidOperationException("This is a read-only filesystem.");
|
||||
throw new UnauthorizedAccessException("This is a read-only filesystem.");
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void CreateDirectory(FileSystemPath path)
|
||||
{
|
||||
throw new InvalidOperationException("This is a read-only filesystem.");
|
||||
throw new UnauthorizedAccessException("This is a read-only filesystem.");
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Delete(FileSystemPath path)
|
||||
{
|
||||
throw new InvalidOperationException("This is a read-only filesystem.");
|
||||
throw new UnauthorizedAccessException("This is a read-only filesystem.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user