mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-02-04 00:44:39 +00:00
[exFAT] Implement GetAttributes.
This commit is contained in:
@@ -38,6 +38,37 @@ namespace Aaru.Filesystems;
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public sealed partial class exFAT
|
public sealed partial class exFAT
|
||||||
{
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public ErrorNumber GetAttributes(string path, out CommonTypes.Structs.FileAttributes attributes)
|
||||||
|
{
|
||||||
|
attributes = new CommonTypes.Structs.FileAttributes();
|
||||||
|
|
||||||
|
if(!_mounted) return ErrorNumber.AccessDenied;
|
||||||
|
|
||||||
|
ErrorNumber errno = GetFileEntry(path, out CompleteDirectoryEntry entry);
|
||||||
|
|
||||||
|
if(errno != ErrorNumber.NoError) return errno;
|
||||||
|
|
||||||
|
if(entry.IsDirectory)
|
||||||
|
attributes |= CommonTypes.Structs.FileAttributes.Directory;
|
||||||
|
else
|
||||||
|
attributes |= CommonTypes.Structs.FileAttributes.File;
|
||||||
|
|
||||||
|
if(entry.FileEntry.FileAttributes.HasFlag(FileAttributes.ReadOnly))
|
||||||
|
attributes |= CommonTypes.Structs.FileAttributes.ReadOnly;
|
||||||
|
|
||||||
|
if(entry.FileEntry.FileAttributes.HasFlag(FileAttributes.Hidden))
|
||||||
|
attributes |= CommonTypes.Structs.FileAttributes.Hidden;
|
||||||
|
|
||||||
|
if(entry.FileEntry.FileAttributes.HasFlag(FileAttributes.System))
|
||||||
|
attributes |= CommonTypes.Structs.FileAttributes.System;
|
||||||
|
|
||||||
|
if(entry.FileEntry.FileAttributes.HasFlag(FileAttributes.Archive))
|
||||||
|
attributes |= CommonTypes.Structs.FileAttributes.Archive;
|
||||||
|
|
||||||
|
return ErrorNumber.NoError;
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ErrorNumber Stat(string path, out FileEntryInfo stat)
|
public ErrorNumber Stat(string path, out FileEntryInfo stat)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ public sealed partial class exFAT
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ErrorNumber Unmount() => throw new NotImplementedException();
|
public ErrorNumber Unmount() => throw new NotImplementedException();
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public ErrorNumber GetAttributes(string path, out CommonTypes.Structs.FileAttributes attributes) =>
|
|
||||||
throw new NotImplementedException();
|
|
||||||
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ErrorNumber OpenFile(string path, out IFileNode node) => throw new NotImplementedException();
|
public ErrorNumber OpenFile(string path, out IFileNode node) => throw new NotImplementedException();
|
||||||
|
|||||||
Reference in New Issue
Block a user