[STFS] Implement GetAttributes.

This commit is contained in:
2025-09-03 03:03:39 +01:00
parent 6b0400a8d5
commit c88bff8fd5
2 changed files with 18 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.IO;
using Aaru.CommonTypes.Enums;
namespace Aaru.Archives;
@@ -73,5 +74,22 @@ public sealed partial class Stfs
return ErrorNumber.NoError;
}
/// <inheritdoc />
public ErrorNumber GetAttributes(int entryNumber, out FileAttributes attributes)
{
attributes = FileAttributes.None;
if(!Opened) return ErrorNumber.NotOpened;
if(entryNumber < 0 || entryNumber >= _entries.Length) return ErrorNumber.OutOfRange;
if(_entries[entryNumber].IsDirectory)
attributes |= FileAttributes.Directory;
else
attributes |= FileAttributes.Normal;
return ErrorNumber.NoError;
}
#endregion
}

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs;
using FileAttributes = System.IO.FileAttributes;
namespace Aaru.Archives;
@@ -11,11 +10,6 @@ public sealed partial class Stfs
{
#region IArchive Members
/// <inheritdoc />
/// <inheritdoc />
public ErrorNumber GetAttributes(int entryNumber, out FileAttributes attributes) =>
throw new NotImplementedException();
/// <inheritdoc />
public ErrorNumber ListXAttr(int entryNumber, out List<string> xattrs) => throw new NotImplementedException();