| GDStorageFileAttributes Property |
Gets the attributes of the current file.
Namespace:
GD
Assembly:
GD (in GD.dll) Version: 255.255.255.255
Syntax Exceptions Exception | Condition |
---|
Exception | (C# equivalent: System.IO.FileNotFoundException) File could not be found. HResult ERROR_FILE_NOT_FOUND. |
Examples
The following example shows how to check the attributes of a file.
using Windows.Storage;
using System.Diagnostics;
using GD;
var appFIle = await GDWindows.Instance.SecureFolder.CreateFileAsync("foo.bar");
FileAttributes fileAttributes = appFIle.Attributes;
if ((fileAttributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
Debug.WriteLine("The item is read-only.");
if ((fileAttributes & FileAttributes.Directory) == FileAttributes.Directory)
Debug.WriteLine("The item is a file.");
if ((fileAttributes & FileAttributes.Archive) == FileAttributes.Archive)
Debug.WriteLine("The item is archived.");
if ((fileAttributes & FileAttributes.Temporary) == FileAttributes.Temporary)
Debug.WriteLine("The item is temporary.");
See Also