Questions tagged [file-attributes]

Question regarding create/read/update file attributes in code

185 questions
2
votes
3 answers

An XML language for describing file attributes of a directory tree?

I have an application in mind which will record directory listings of a file system in text form. That is, it should say something like: File name is: abc.txt Last modification date is: 2009-12-31T01:23 Read-only attribute is: True Hidden attribute…
2
votes
2 answers

How to check if a file is executable in Lua?

How can I check in Lua if a string is the path to an executable file? It seems that neither the standard library nor, surprisingly, LuaFileSystem provides a way to do this.
2
votes
1 answer

Writing Spotlight metadata to files on OS X (specifically kMDItemDisplayName)

I see that this has been answered previously by Ken T., but I have a case where the code appears to work, and the call to setxattr() returns 0, but the item I want to modify does not change. Specifically, I'm trying to change the metadata attribute…
2
votes
2 answers

File attribute flags is controlled by code or OS?

I am learning about the file attribute enum and have a two questions which I can't find a concrete answer to (although I have my own opinion). My application checks to see if the Archive flag has been set or not. During my testing, I create a .txt…
Dave
  • 8,163
  • 11
  • 67
  • 103
2
votes
1 answer

java.nio.file.Files.setOwner() not permitted

I am writing an attendance program in Java for use in class; my goal is to be able to have the students download the class file to their accounts (we'll be working on the same network) and then run them with their usernames and a password that will…
Daniel Brady
  • 934
  • 3
  • 11
  • 27
1
vote
2 answers

How to work with Core Data and iOS 5 storage guidelines?

I wrote an app that allows users to store text articles in Core Data. I'm using a sqlite backing store. So what "category of data", as mentioned in this technical note (login may be required), should my .sqlite data fall into? I would think…
Moshe
  • 57,511
  • 78
  • 272
  • 425
1
vote
3 answers

How to find if an item in a Windows folder is really hidden from the user?

I need to get the count of items (folders and files) in a Windows folder. I can easily do it based on the condition if I should include hidden items or not. But in my program I want to get the count of items that is visible to the user! i.e. if…
nawfal
  • 70,104
  • 56
  • 326
  • 368
1
vote
1 answer

Using Batch to copy file attributes (at least Created,LastWrite,LastAccess) from 1 file to a 2nd

I am trying to copy attributes for *.mkv *.mp4 video files. I have found a way to copy file attributes, but it is quite slow as it is calling Powershell to use it commands. powershell ^(ls '!orig-file!'^).CreationTime = ^(ls…
hsgg4
  • 31
  • 1
  • 5
1
vote
0 answers

Getting FileAttribute error for files stored on my Mac

I am trying to show a list of files from my computer using a server app that uses the IP address and you can look for a file from the phone. I am fetching files successfully, but I have a problem with showing the size and creation date of files.…
Mc.Lover
  • 4,813
  • 9
  • 46
  • 80
1
vote
1 answer

Changing file attribute to read-only on assembly with INT 21,43 does not work

I am quite new to assembly and recently I have been struggling to make INT 21,43 (changing file attribute to read-only) work. I am using Windows 10, DOSBox x86, and Turbo Assembler/Linker/Debugger if that makes any difference. As far as I can tell…
1
vote
1 answer

Remove read-only attribute from existing files in Inno Setup

I'm creating a setup with Inno Setup. This setup adds files to a "main program" and after installing some files it runs another custom program which kind of unpacks some previously installed files. This unpacking program relies on some existing…
Nostromo
  • 1,177
  • 10
  • 28
1
vote
4 answers

Is it possible to do a 'find . -ctime n' in JDK7?

Is it possible to do a equivalent 'find . -ctime n' (Unix command) in JDK7? i.e. find all files based on last changed time? I had a look at the new FileVisitor/BasicFileAttributes/SimpleFileVisitor classes but I cannot see how it could be done.
Wayne
  • 914
  • 2
  • 13
  • 25
1
vote
1 answer

Why is my batch script hiding processed files/folders?

Can anyone here give me a hint, why my batch script marks successfully processed folders as system, hidden, non-archive? Furthermore I cannot even remove the "hidden" attribute via Explorer (probably because of the systemfolder attribute). The…
Roberto
  • 21
  • 6
1
vote
0 answers

How to retrieve NTFS File attributes in C#

I was really surprised when I found out, that I did not find any way to read all NTFS attributes. I can access some attributes through the following lines: public static void Main() { // Get Attributes for file. FileInfo info = new…
David Mason
  • 329
  • 3
  • 14
1
vote
1 answer

Read file extended attributes of files on SFTP server with JSch

I want to read file extended attributes using com.jcraft.JSch 0.1.55 (the file is on SFTP server). I know that class SftpATTR actually does have a method public String[] getExtended() but in my case it returns null. I see that in this code static…
jaros
  • 323
  • 1
  • 3
  • 15