Question regarding create/read/update file attributes in code
Questions tagged [file-attributes]
185 questions
1
vote
1 answer
remove extended attribute : fails
From a shell script, I'm trying to remove extended attribute
setfattr -x security.selinux file.txt
The file.txt has mode 777, but im getting "permission denied error".
How can I fix this?

webminal.org
- 44,948
- 37
- 94
- 125
1
vote
1 answer
Access the Windows context indexing file attribue using dotnet
How can I programmatically read and write the file and folder attribute which is set by the Windows "Allow files on this drive to have contents indexed in addition to file properties" dialog?

stovroz
- 6,835
- 2
- 48
- 59
1
vote
0 answers
Java. Reading exe/dll attributes
I'm trying to read attributes of an .exe file (specifically - product name and product version) in java but have a slight problem with that. From what i read it should be doable with Java.NIO but this code (suggested in all examples and in different…

NekoiNemo
- 47
- 6
1
vote
1 answer
How to atomically set the value of the file attribute in java?
I need to atomically set the value of the file attribute in java. I found the method
Path Files.setAttribute(Path path, String attribute, Object value, LinkOption... options)
but the documentation is not specified that the value will be set…

st_nikolas
- 31
- 4
1
vote
1 answer
C# How to change FileAttributes from Normal to Directory
A friend of mine gave me a corrupted SD Card which shows the "DCIM" folder as file.
I wrote a Console program to show me FileInfo, and it returns "Normal". Now I tried to change the FileAttributes from "Normal" to "Directory" like in the sample:…

mausberger
- 55
- 5
1
vote
1 answer
File attribute selection error
I have this code where you are suppose to be able to pick specific file attributes, but for some reason it is acting really weird. Can anyone spot the error(s)?
This is in a form, I am triggering checkAttributes when a file is selected.…

thijmen321
- 473
- 1
- 3
- 13
1
vote
1 answer
Unreachable expression code in LINQ query
I'm trying to construct a parallel query using LINQ to get all of the text files and one CSV file in a certain directory and its subdirectories. I want to exclude hidden, temporary, and system files from even being considered by the query in hopes…

Alex A.
- 5,466
- 4
- 26
- 56
1
vote
1 answer
FUSE Extended Attributes
I'm trying to implement a FUSE file system including the ability to set/get extended file attributes. In this case, the attribute that I am interested in is one to create a boolean condition to mark a file as encrypted. Let's say that I have a file…

AndroidDev
- 20,466
- 42
- 148
- 239
1
vote
1 answer
What Windows' programs or services might alter the LastAccessed attribute of a file?
I have a license file that I wish to invalidate if any program other than ours reads the file. My idea is to use File.GetLastAccessedTime(string) and save this value off to the file to be checked when we read the file back in.
However, I am afraid…

codewario
- 19,553
- 20
- 90
- 159
0
votes
3 answers
Keep Attributes of Version Controlled Files Unchanged
Is it possible to keep the attributes of a version controlled file unchanged? I have a directory structure which I'd like my installer to recreate on the client machine. I was hoping the entire directory could be placed on VCS without affecting the…

Agnel Kurian
- 57,975
- 43
- 146
- 217
0
votes
2 answers
File id for keeping track of file changes in Java?
I'm trying to find a way to keep track of files even when they are moved or renamed in the file system.
One idea I had was to use the new UserDefinedFileAttributeView in Java 7 and create a custom file attribute as a sort of custom id. I thought…

Anders
- 12,556
- 24
- 104
- 151
0
votes
1 answer
How to change Linux file attributes
I am working in C not in CPP and want to change the attributes of a executable file to hidden, read only, executable. I also want to change file's permission using my C-code. How can I do that?

Cool Java guy מוחמד
- 1,687
- 4
- 24
- 40
0
votes
4 answers
PHP script to delete thousands of .jpg images?
My weak shared web host doesn't support cron or perl and I often need to delete thousands of .jpg images from certain folders. The images are uploaded from webcams. I'm wondering if there is a simple app out there that can find all .jpg images…

Wes
- 79
- 2
- 10
0
votes
0 answers
Accessing extended file attributes without the 'user' prefix: impossibile?
It seems that Java (Java 17 and 20) is not able to read extended file attributes not having the prefix user in their name. I've done my research and test, but I'd like to have a confirmation before proceeding with a B-plan for my application.
More…

Fabrizio Giudici
- 532
- 3
- 15
0
votes
1 answer
PowerShell script to set "date created" to specific times according to a csv file
I have some thousands of files in a folder that I need to bulk edit their creation time to a specific order.
I have prepared a csv file with all file names and the preferred creation times, like this:
filename;filecreationTime;
file1.mp4;10/11/2022…

Helias Valenti
- 1
- 1