forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfiles.lcdoc
More file actions
66 lines (43 loc) · 3.17 KB
/
files.lcdoc
File metadata and controls
66 lines (43 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Name: files
Type: function
Syntax: the [{ detailed | long }] files
Syntax: files()
Summary: Returns a list of <files> in the <defaultFolder>.
Introduced: 1.0
OS: mac,windows,linux,ios,android
Platforms: desktop,server,web,mobile
Security: disk
Example:
put the files into field "Current Files"
Example:
repeat with x = 1 to the number of lines of the detailed files
Example:
put the files & the folders into diskContents[the defaultFolder]
Returns:
The <files> <function> returns a list of file names, one per <line>.
The detailed files form returns a list of files, one file per line. Each line contains the following attributes, separated by commas:
1. The file's name, URL-encoded
2. The file's size in bytes (on Mac OS and OS X systems, the size of the file's data fork)
3. The resource fork size in bytes (Mac OS and OS X systems only)
4. The file's creation date in seconds (Mac OS, OS X, and Windows systems only)
5. The file's modification date in seconds
6. The file's last-accessed date in seconds (Unix, OS X and Windows systems only)
7. The file's last-backup date in seconds (Mac OS and OS X systems only)
8. The file's owner (Unix and OS X systems only)
9. The file's group owner (Unix and OS X systems only)
10. The file's access permissions
11. 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.
Description:
Use the <files> <function> to obtain a list of <files> to display for the user, or to perform an action on each <file> in the <current folder>.
Folders in the <defaultFolder> are not included. To get a list of folders, use the <folders> function.
The names of aliases (on Mac OS and OS X systems), symbolic links (on Unix systems), and shortcuts (on Windows systems) are included in the value returned by the <files> if they refer to a <file>. If they refer to a <folder>, they are not included.
The forms the detailed files and the long files are synonyms.
When listed in the detailed files form, each file's name is URL-encoded. To obtain the name in plain text, use the <URLDecode> function. If the detailed modifier is not used, the filename is not encoded.
The access permissions returned in the detailed files form consist of three octal digits. The form is the same as that used for the <umask> property.
The creator and file type returned in the detailed files form is an eight-character string. The first four characters are the creator signature, and the last four are the file type.
>*Note:* For efficiency reasons, the <files> function returns a list in the order provided by the operating system which can differ between platforms and even file systems. If you require an ordered list use the <sort> command explicitly afterwards.
Changes:
The detailed files form was introduced in version 1.1. In previous versions, the <files> function provided only a list of file names.
References: fileType (property), umask (property), defaultFolder (property), file (keyword), line (keyword), sort (command), answer file (command), folders (function), files (function), volumes (function), URLDecode (function), current folder (glossary), folder (glossary), function (control_st)
Tags: file system