t = GetFileAttributes(f$[, table])
t = GetFileAttributes(f$[, adapter$])
This function accepts an optional table argument which can be used to pass additional parameters. The following table elements are currently recognized:
Adapter:
UserTags:On return, the table will have the following fields initialized:
Type:#DOSTYPE_FILE if f$ is a file or #DOSTYPE_DIRECTORY if f$ is
a directory.
Path:
Size:f$ is a file. In that case, this field
will receive the size of the file in bytes.
Flags:
Time:
LastAccessTime:
CreationTime:
Comment:
Virtual:True if the file you passed to this function is
a virtual file, i.e. a file linked to your applet/executable or a file
created using DefineVirtualFile(). (V5.2)
Name:Path field. The only case where this field is really useful is when working
with Storage Access Framework (SAF) or MediaStore URIs on Android. Those
URIs are often in a custom format which might not contain the file or
directory name at all. In that case you can use this field to find out the
actual name of the file or directory. See Working with Android URIs for details.
(V11.0)
MIMEType:If you want to query the attributes of a file that you have opened using OpenFile(), use FileAttributes() instead. See FileAttributes for details.
t = GetFileAttributes("test.txt")
Print(t.time)
If t.flags & #FILEATTR_READ_USR
Print("#FILEATTR_READ_USR is set.")
Else
Print("#FILEATTR_READ_USR is not set.")
EndIf
The code above examines the file "test.txt" and prints the time it was
last modified to the screen. Additionally, it checks if the protection
flag #FILEATTR_READ_USR is set.