[exFAT] Implement GetAttributes.

This commit is contained in:
2026-02-03 12:10:56 +00:00
parent f7792627aa
commit 56f9cd914c
2 changed files with 31 additions and 4 deletions

View File

@@ -38,6 +38,37 @@ namespace Aaru.Filesystems;
/// <inheritdoc />
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 />
public ErrorNumber Stat(string path, out FileEntryInfo stat)
{

View File

@@ -39,10 +39,6 @@ public sealed partial class exFAT
/// <inheritdoc />
public ErrorNumber Unmount() => throw new NotImplementedException();
/// <inheritdoc />
public ErrorNumber GetAttributes(string path, out CommonTypes.Structs.FileAttributes attributes) =>
throw new NotImplementedException();
/// <inheritdoc />
public ErrorNumber OpenFile(string path, out IFileNode node) => throw new NotImplementedException();