I have a hidden file on my USB removable storage (FAT file system).
I'm using Windows 7. If I go to Properties window of this file and then to the Details tab, I will see that the attributes of the file are HX
. When I run cmd
and use attrib
, I was told that file has attribute H. Nothing about X. I've tried help attrib
, but still nothing about attribute X.
I know that:
However, I have no idea what X stands for. I've also found what the N and E attributes are for.
Wikipedia has no mention of what the X attribute is.
Google found two topics mentioning attribute X:
None of these helped.
I'd like to be able to read/write this flag in C#, but so far I read the documentation for the FileAttributes
enumeration and experimented with setting some of listed attributes (using File.GetAttributes
& File.SetAttributes
methods) on the file.
None of these experiments resulted in attribute X showing up in Properties -> Details. So, I have no idea how to approach it, especially since I still don't know what attribute X means.
So, what is attribute X and how can one set/clear it on the selected file in C#?
Open File Explorer and go to the folder that contains your files. Select the file whose attributes you want to change. On the Home tab of the Ribbon, click on the Properties button. In the next dialog, under Attributes, you can set or remove the Read-only and Hidden attributes.
Changing file attributes To view or change the attributes of a file, right-click the file, and then click Properties. In the "Attributes:" section, enabled attributes have checks beside them. Add or remove the checks from Read-only, Archive, or Hidden to enable or disable these options.
ls lists files and directories. If the pathname is a file, ls displays information about the file according to the requested options. If it is a directory, ls displays information about the files and subdirectories therein. You can get information about a directory itself using the –d option.
In Linux, file attributes are meta-data properties that describe the file's behavior. For example, an attribute can indicate whether a file is compressed or specify if the file can be deleted. Some attributes like immutability can be set or cleared, while others like encryption are read-only and can only be viewed.
Maybe I'm wrong but... I think that X attribute means that the file has extended attributes. Unfortunately, extended attributes can't be modified using C#.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With