Question regarding create/read/update file attributes in code
Questions tagged [file-attributes]
185 questions
7
votes
1 answer
c# check if a directory is hidden?
Possible Duplicate:
How to test if directory is hidden in C#?
DirectoryInfo dir = new DirectoryInfo(@"c:\test");
if ((dir.Attributes & FileAttributes.Hidden) == (FileAttributes.Hidden))
{
//do stuff
}
With this if statement i would like…

user436238
- 73
- 1
- 3
7
votes
2 answers
Java NTFS compression attribute
I need to read and modify the 'Compressed' attribute of a file on an NTFS partition from Java. I imagined something in the java.nio.file.attribute package would do it -- hell it's a complex enough package, but I can't find this attribute.
The…

Boann
- 48,794
- 16
- 117
- 146
7
votes
2 answers
How FileAttributes.Encrypted work in C#?
I didn't find any example on google... Can anyone show how it works? And when folders and files will be encrypted how to decrypt them?
Link:
FileAttributes Enumeration

a1204773
- 6,923
- 20
- 64
- 94
6
votes
1 answer
Obtain last modification date/time of file as local date/time string
new File(url).lastModified() returns a long equal to the number of milliseconds since the epoch, which is GMT-based.
What is a simple way to convert this to a String representing system-local date/time?
If you really need to see an attempt from me…

Museful
- 6,711
- 5
- 42
- 68
6
votes
1 answer
Python documentation for os.removexattr -- what does the '*' (star) argument mean?
My first question, please be gentle. I searched but could not find an answer here or elsewhere.
Note that this question does not apply to unpacking of arguments like *args.
In the python 3.3 documentation for os.removexattr the following is…

user3122335
- 108
- 4
6
votes
2 answers
Find all files with (corrupt) future date and modify to today
231, of a few thousand, files in a folder hierarchy have bad (null?) creation & modification dates. I can identify them:
find . -mtime -0
And their dates are all well into the future. Not sure exactly but the few I've looked at with ls -l appear to…

Meltemi
- 37,979
- 50
- 195
- 293
5
votes
2 answers
Set file compression attribute
I expected this code:
if (!File.Exists(fullFileName))
{
File.Create(fullFileName);
}
File.SetAttributes(fullFileName, FileAttributes.Compressed);
To set this flag:
But it doesn't... What am I doing wrong? How do I set that flag on a…

Jonathan
- 8,771
- 4
- 41
- 78
5
votes
1 answer
How to add Copyright and Authors info to Images created in PHP?
Is there any way to add Copyright info to the image file created by PHP?
To be clearer, you can add copyright info to a file with photoshop, so when you get its properties, you see something similar to:
I want to Add/Edit Details info of a file…

Ormoz
- 2,975
- 10
- 35
- 50
5
votes
2 answers
Msys shell command to change the attributes of a file
Please let me know a MSYS shell command that can be used for changing the attributes of a file. When I ran a command as ls -l I got the following :
-rw-r--r-- 1 lenovo Admin .....m4sugar.m4
I want to provide full access rights.
Any help is highly…

eddie
- 252
- 1
- 5
- 15
4
votes
2 answers
Extract Assembly Version from DLL using Python
I'm trying to extract some version information from a DLL using python. I read this question:
Python windows File Version attribute
It was helpful, but I also need to get the 'Assembly version' from the DLL. It's there when I right click and look on…

Mark Irvine
- 1,349
- 14
- 24
4
votes
0 answers
How to create a zip archive with some readonly files with maven-assembly-plugin
I have a project with 2 files (src/foo/a.txt and src/foo/b.txt) and I want to create a zip archive where b.txt is in readonly.
Here's my environment:
Windows 7
JRE 1.8.0_112
Maven 3.3.3
maven-assembly-plugin 3.0.0
7-Zip 9.20
Here's my…

Pigelvy
- 606
- 6
- 17
4
votes
2 answers
How to read or write the a s h r i file attributes on Windows using Python and ctypes?
For the records:
a means 'archivable'
s means 'system'
h means 'hidden'
r means 'readonly'
i means 'indexable'
My current solution to read/write these attributes from Python scripts is to call attrib using the subprocess module.
Python…

Nils Lindemann
- 1,146
- 1
- 16
- 26
4
votes
3 answers
Delete link to file without clearing readonly bit
I have a set of files with multiple links to them.
The files are owned by TFS source control but other links to them are made to them. How do I delete the additional links without clearing the readonly bit.
It's safe to assume:
The files have more…

Joshua
- 40,822
- 8
- 72
- 132
4
votes
1 answer
tar archive without metadata
Simple example:
tar cf
md5sum
touch
tar cf
md5sum
Results of md5sum are different.
How to avoid this?
user3539787
4
votes
2 answers
C#/.NET: Retrieving the contents/file attributes from a file inside a recycle bin
I just wanna ask if there's a possibility to retrieve the contents of a 'dump' file from the recycle bin programatically. The contents that I'm looking for are file attributes like 'Date Last Modified, 'Data created', 'size', etc (without restoring…

abramlimpin
- 5,027
- 11
- 58
- 97