Getting certain file attrib / attributes
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Getting certain file attrib / attributes
Hello, I searched for a method to to find out a particular Attrib of a file to no avail, particularly the "Attributes" section (pics below).
I just had a few questions:
1. Is there a LC command I am missing that can set file attributes besides using shell command
2. Is there a way to get the specific attrib in the pics below with a LC command. I am unsure on how to use shell command here.
2a. Generic - I know there is a command "files" and you can code to find certain attributes, which looks thru a folder. Is there a LC command to just target a single file with a file path?
I tested the below file pics and both give me 777.
Files command excerpt:
The detailed files form returns a list of files, one file per line. Each line contains the following attributes, separated by commas:
* The file's name, URL-encoded
* The file's size in bytes (on Mac OS and OS X systems, the size of the file's data fork)
* The resource fork size in bytes (Mac OS and OS X systems only)
* The file's creation date in seconds (Mac OS, OS X, and Windows systems only)
* The file's modification date in seconds
* The file's last-accessed date in seconds (Unix, OS X and Windows systems only)
* The file's last-backup date in seconds (Mac OS and OS X systems only)
* The file's owner (Unix and OS X systems only)
* The file's group owner (Unix and OS X systems only)
* The file's access permissions
* The file's creator and file type (Mac OS and OS X only)
Any attribute that is not supported on the current system is reported as empty.
I just had a few questions:
1. Is there a LC command I am missing that can set file attributes besides using shell command
2. Is there a way to get the specific attrib in the pics below with a LC command. I am unsure on how to use shell command here.
2a. Generic - I know there is a command "files" and you can code to find certain attributes, which looks thru a folder. Is there a LC command to just target a single file with a file path?
I tested the below file pics and both give me 777.
Files command excerpt:
The detailed files form returns a list of files, one file per line. Each line contains the following attributes, separated by commas:
* The file's name, URL-encoded
* The file's size in bytes (on Mac OS and OS X systems, the size of the file's data fork)
* The resource fork size in bytes (Mac OS and OS X systems only)
* The file's creation date in seconds (Mac OS, OS X, and Windows systems only)
* The file's modification date in seconds
* The file's last-accessed date in seconds (Unix, OS X and Windows systems only)
* The file's last-backup date in seconds (Mac OS and OS X systems only)
* The file's owner (Unix and OS X systems only)
* The file's group owner (Unix and OS X systems only)
* The file's access permissions
* The file's creator and file type (Mac OS and OS X only)
Any attribute that is not supported on the current system is reported as empty.
- Attachments
-
- -A
- Capture2.PNG (2.05 KiB) Viewed 6021 times
-
- +A
- Capture.PNG (2.88 KiB) Viewed 6021 times
Re: Getting certain file attrib / attributes
Hi newpie,
1. No.
2. No. No idea how to use shell for this, sorry...
2.a. Unfortunately not.
Best
Klaus
1. No.
2. No. No idea how to use shell for this, sorry...
2.a. Unfortunately not.
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Getting certain file attrib / attributes
It would be convenient to have a built-in function for getting info on a single file (and I believe there's a request for this in queue), but in the meamtime using the detailed files you can script your own function in a few minutes.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Getting certain file attrib / attributes
@Klaus = Thank you Klaus for your response.
@FourthWorld = Can you confirm this request in the queue, specifically the attrib I am looking in the pics, or should I put a post this in the idea forum.
Thanks
@FourthWorld = Can you confirm this request in the queue, specifically the attrib I am looking in the pics, or should I put a post this in the idea forum.
Thanks
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Getting certain file attrib / attributes
I don't know what "A" and "N" signify in your screen shot above. Everything else is available in the detailed files.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Getting certain file attrib / attributes
Here is the list of attributes the "N" is = to "I".
I didn't test all these attributes, are you saying I can see these (besides I/N) easily with the detailed files command? Is there a request for these that you know of.
Thanks FourthWorld
I didn't test all these attributes, are you saying I can see these (besides I/N) easily with the detailed files command? Is there a request for these that you know of.
Thanks FourthWorld
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Getting certain file attrib / attributes
Your first post here shows that you're looking for file size, date created, and date modified. That post also includes the relevant portion of the Dictionary entry showing those elements are included in the info returned from "the detailed files". Even access permissions are shown there (though I'd have to double check that entry to make sure that reflects things specific to the Windows for system).
Looks like you have everything you're looking for right at your finger tips. Use lineoffset with a urlEncode on the name of the file you're looking for to get the line number, then grab the relevant items from that line.
Looks like you have everything you're looking for right at your finger tips. Use lineoffset with a urlEncode on the name of the file you're looking for to get the line number, then grab the relevant items from that line.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Getting certain file attrib / attributes
I apologize for the confusion. I was specifically looking for the -A and N attribute actually from my first post. I just listed the "files"dictionary excerpt to show what is there already. I tested the Hidden attribute and the three octal digits from the "files" command is still 777. So from what I can tell I can't find this data with the "files" command. What is your thoughts on this? I might put in the idea forum then just in case.
Thanks
Thanks
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Getting certain file attrib / attributes
You may have to use LC's shell function to call out to DOS or PowerShell for Windows-specific file system attributes.
This will all become much simpler once Windows adopts a Linux kernel.
This will all become much simpler once Windows adopts a Linux kernel.

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn