Question regarding create/read/update file attributes in code
Questions tagged [file-attributes]
185 questions
3
votes
3 answers
nodejs fs mode manipulation in windows read-only attribute
I am new to NodeJS and I'm having a hard time decrypting the mode value and figuring out how to change the mode to remove an attribute like read-only. Here is how I found this folder to have a mode of 16822. How do I determine what 16822 means in…

Csharpfunbag
- 395
- 3
- 19
3
votes
2 answers
Delphi: SetFileDate creates wrong LastWriteTime (Summer/Wintertime)
i am downloading a file from my server (i only get the bytes and a DateTime for the lastwritetime attribute) and after downloading the data i create a new file on my local machine and want to set the lastwritetime attribute.
For this i am using the…

TryToSolveItSimple
- 873
- 1
- 12
- 23
3
votes
1 answer
What is the best pratice to get a file attribute(such as read only), and security attribute(such as read deny write deny)?
I am programming in C++ MFC, windows.
What is the best practice to get a file attribute(such as read only), and security attribute(such as read deny write deny) in windows XP, Vista, and Win7?
and What is the best practice to modify a file…

sxingfeng
- 971
- 4
- 15
- 32
3
votes
4 answers
Strange attribute value reported by FindFirst(), Attr = 2080
When searching for files with FindFirst() I get an attribute value in the TSearchRec.Attr field of 2080. It is not specified in the help as there are only these values available and no combination of them yields 2080:
1 faReadOnly
2 faHidden
4…

Niklas Winde
- 1,761
- 3
- 23
- 33
3
votes
1 answer
where does NTFS stores file attributes
I'm currently developing a file system and doing some research on existing ones, and in the file system I have in mind I would like to add extra metadata (or file attributes) to files besides the ones generally stored by FS's like NTFS that stores…

user2900870
- 327
- 3
- 8
3
votes
1 answer
Where can I find the list of attributes name?
I am just wondering if there is a list of attributes name to be referred when using the following:
However, you can set a DOS attribute using the setAttribute(Path,
String, Object, LinkOption...) method, as follows:
Path file = ...;…

Rollerball
- 12,618
- 23
- 92
- 161
3
votes
1 answer
Checking if a Folder/File is Hidden/System in Windows C/C++
I am writing a Cross platform application using C++/STL/Boost and I realized they do not provide a way to check if a folder or file is hidden or is a system file in Windows.
What's the simplest way to do this in C/C++ for Windows ?
Ideally I have…

The Unknown
- 19,224
- 29
- 77
- 93
3
votes
1 answer
Does iOS keep file modification dates updated?
I'm trying to determine whether (and when) a file in my app's temp file directory has been modified, but the modification date (NSFileModificationDate in the file attributes) seems to always match the creation date (NSFileCreationDate). I have some…

Caleb
- 124,013
- 19
- 183
- 272
2
votes
4 answers
Can't write to file immediately after creation
In the following code:
if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/data.dat"))
{
File.AppendAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/data.dat", temp);
}
else
{
…

user1138208
- 21
- 1
- 2
2
votes
1 answer
The number of blocks allocated to a sparse file
Is there any way to access the number of blocks allocated to a file with the standard Java File API? Or even do it with some unsupported & undocumented API underneat. Anything to avoid native code plugins.
I'm talking about the st_blocks field of…

Christian
- 9,417
- 1
- 39
- 48
2
votes
4 answers
create file with FileStream and apply FileAttributes
Is it possible while creating the file with FileStream also apply FileAttributes at the same time? I would like to create file for stream writing with FileAttributes.Temporary file attribute.

Tomas
- 17,551
- 43
- 152
- 257
2
votes
2 answers
Type guarantees for getting DOS file attributes in Java
In a directory using Java I want to check each subdirectory for a DOS-specific attribute, but I want the code to run on other file systems as well. I can do this, which seems to be what the Java API implies is the recommended approach:
try {
…

Garret Wilson
- 18,219
- 30
- 144
- 272
2
votes
1 answer
How does POSIX distinguish files from directories?
How does POSIX distinguish files from directories?
On DOS and Windows, a directory is nothing more than a file with the D attribute. I tried to figure out how to differ them on POSIX-compatible operating systems like Linux and BSD, but it doesn't…

user90726
- 939
- 1
- 8
- 28
2
votes
2 answers
Efficient Script to get all Extended File Properties
I'm pretty new working with Powershell and i have some working code but I'm not sure how to get it into an efficient routine to return all of the extended file properties of some video files i have.
I have:
# The basic setup for the next steps
$path…

jimerb
- 67
- 9
2
votes
1 answer
Is there a way to verify if a file is a special block file in Java?
I have a special use case where I need to verify if a file is a special block file (only if my java program is run on Linux). My code can already detect if it's ran on Windows or Linux, so if it's windows I simply invalidate the verification.
For…

Lorenzo
- 591
- 7
- 18