0

When listing files in WinRT(C#) using something like GetFilesAsync(..) I would like to know if there is a way I could tell it to only return files that are hidden or temporary. Or when I list all the files to go through each file and check if they are hidden or temporary. You could do this in .net with FileInfo(http://msdn.microsoft.com/en-us/library/system.io.fileinfo.aspx)

Thanks

Kuppa
  • 23
  • 3

2 Answers2

0

It seems like the StorageFile type used when listing files in WinRT seems to have a similar Attributes property to the FileInfo.Attributes property found in desktop version of .NET. Its type has the same name too and is called FileAttributes, which is an enum that has a possible value of Temporary. It seems to be missing a Hidden value found in .NET and if I were to venture a guess I'd say that's because hidden files are not visible and it seems to be confirmed by Mike Taulty's blog post. The search methods in WinRT don't seem to have an attributes-based filter, so you will need to either iterate through the files to check for the attribute or use something like LINQ to filter out the ones that don't match your criteria.

Filip Skakun
  • 31,624
  • 6
  • 74
  • 100
  • I was hoping to not get that answer :( Unfortunately I needed to tell weather a file was hidden or not, because even though they are files a user could not normally see, it still a file that gets listed. It's hard for developers to not count hidden files when you don't know if it is a hidden file. – Kuppa Sep 18 '13 at 20:43
0

To add to the above answer, there is no way at all, using WinRT API's, to get access to hidden files. The WinRT brokers simply won't list them or give you access to them.

Alireza Noori
  • 14,961
  • 30
  • 95
  • 179
Johnny Westlake
  • 1,461
  • 10
  • 13