Question regarding create/read/update file attributes in code
Questions tagged [file-attributes]
185 questions
0
votes
1 answer
Modifying file properties/metadata
I can get a file's properties/metadata by calling Shell32.Folder.GetDetailsOf, but I can't seem to figure out how to modify those attributes. The properties I'm referring to are the "extended details" like Camera model and Camera name for image…

rafale
- 1,704
- 6
- 29
- 43
0
votes
0 answers
Attribute of Workdir of Docker container turned to "c(character device file)" from "d(directory)" after running for a while
The question is found from a docker command error when I tried to execute exec command to a container:
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: chdir to cwd ("/home/admin") set in config.json…

Jeffery Don
- 1
- 1
0
votes
1 answer
How to attach attribute to a PDF file programmatically?
How to attach attribute to a PDF file programmatically, without acrobat or any other reader So that it will opened with Zoom to fit width, I've copied this attribute from Smatra pdf viewer settings file?
By default a file opened in browser with fit…

waqas chughtai
- 19
- 5
0
votes
1 answer
FileManager: Attribute for when a file was last opened
I need a way of checking when a file was last opened. I tried by creating a custom FileAttributeKey and setting that to the current Date, but when I go to open the file again the attribute does not exist:
private let key = FileAttributeKey(rawValue:…

Michael Jajou
- 312
- 2
- 13
0
votes
0 answers
Last change date of file is resetting to current DateTime when looking at it in explorer
I am currently writing a software in C# that downloads e-mails from an IMAP server.
The files are saved and the last write date is set to the email date.
At first everything seems to work, but when I'm surfing the folder where the files are saved…

Oliver
- 11
- 1
0
votes
1 answer
FindFirstFile/FindNextFile dwFileAttributes unexpected value (or not)?
When I run my code, the file attribute is 32 for all of my files.
According to this Microsoft docs page:
FILE_ATTRIBUTE_ARCHIVE, 32 (0x20), A file or directory that is an archive file or directory. Applications typically use this attribute to mark…

core36
- 17
- 5
0
votes
1 answer
How to check for character files in a directory
I got this code from this post
#include
#include
#include
#include
void main()
{
char* folder="/dev/input"; //folder to open
DIR* dir_p;
struct dirent*…

Animesh Sethi
- 3
- 1
- 2
0
votes
1 answer
Java NIO Read Folder's content's attributes at once
I'm writing a backup program using Java and the package NIO.
As far as I found, I could do it as in the code example below, i.e. read the folder content list and then for each file I have to do file attributes request... this is not an effective…

Sunny
- 83
- 1
- 7
0
votes
2 answers
Make a file Readonly from code, and also doesnt allow to change it from the Properties
I would like to change a file to read only from my application.
For that i have used,
SetFileAttributes(szFile, FILE_ATTRIBUTE_READONLY);
And worked.
But the readonly property could be changed from the file properties on right clicking the…

JijeshKV
- 670
- 2
- 7
- 26
0
votes
1 answer
Linux setxattr: possible to use Unicode string?
I wrote the following code in VS Code and ran it to set file attribute. It seemed to have run successfully, but when I checked the value, the text was not correct. Is Unicode string supported for file extended attributes? If so, how can I fix the…

Damn Vegetables
- 11,484
- 13
- 80
- 135
0
votes
0 answers
C# write multiple console lines to text file
I am trying to print the file attributes, for every file in a given folder, to a new text file.
I can print them to the console successfully with this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using…

phpwhatthertf
- 83
- 1
- 10
0
votes
0 answers
How to get creation date of a file in a Scala dataframe
How to print the date of a file in Scala is explained here.
My question is how I can get a variable containing this information which can be returned as a column to a dataframe. None of the conversions I would expect to be allowed, actually are…

M.S.Visser
- 61
- 1
- 6
0
votes
1 answer
Files list returned by os.walk is not in any discernible order
Is there any way to sort the list of file names returned by os.walk such that it returns a list that is from youngest file to oldest file? Im trying to write a code that deletes files after a certain amount of time.
Here's what i have:
import…

Gabriel
- 1
0
votes
1 answer
How do I only view directories containing PDFs with ReadOnly attribute in my C# TreeView?
I have a TreeView in my C# Form and I want it to only display directories containing PDFs that are not Read-Only. The files should also be displayed.
My current code:
private static TreeNode CreateDirectoryNode(DirectoryInfo directoryInfo)
{
…

TheAllstar85
- 3
- 1
0
votes
1 answer
bzr: Ignore attributes when committing / pulling
I have one system with msys2, and another system with Ubuntu.
Files in Unix have the executable attribute.
Files in msys2 (NTFS based) do not have the executable attribute (although msys2 "fakes" it by looking for the shebang in the first line of…

sancho.s ReinstateMonicaCellio
- 14,708
- 20
- 93
- 185