From 16c92a430d307164780347b5d469de79c4fa251f Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 2 Aug 2019 00:34:03 +0100 Subject: [PATCH] Implement getattrs for Opera. --- DiscImageChef.Filesystems/Opera/File.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/DiscImageChef.Filesystems/Opera/File.cs b/DiscImageChef.Filesystems/Opera/File.cs index 5184cc61a..f482fdfa9 100644 --- a/DiscImageChef.Filesystems/Opera/File.cs +++ b/DiscImageChef.Filesystems/Opera/File.cs @@ -10,7 +10,19 @@ namespace DiscImageChef.Filesystems { public Errno MapBlock(string path, long fileBlock, out long deviceBlock) => throw new NotImplementedException(); - public Errno GetAttributes(string path, out FileAttributes attributes) => throw new NotImplementedException(); + public Errno GetAttributes(string path, out FileAttributes attributes) + { + attributes = new FileAttributes(); + if(!mounted) return Errno.AccessDenied; + + Errno err = Stat(path, out FileEntryInfo stat); + + if(err != Errno.NoError) return err; + + attributes = stat.Attributes; + + return Errno.NoError; + } public Errno Read(string path, long offset, long size, ref byte[] buf) => throw new NotImplementedException();