Nasal library/io: Difference between revisions

Jump to navigation Jump to search
Line 300: Line 300:
|syntax = io.stat(path);
|syntax = io.stat(path);
|text = Calls {{wikipedia|stat (system call)|stat}} and returns an array containing 12 pieces of data. See the table below for a list of them in order from first in the vector to last.
|text = Calls {{wikipedia|stat (system call)|stat}} and returns an array containing 12 pieces of data. See the table below for a list of them in order from first in the vector to last.
{{{!}} class="wikitable"
! Data !! Meaning
{{!-}}
{{!}} dev {{!!}} Identifier of device containing file
{{!-}}
{{!}} ino {{!!}} Inode number
{{!-}}
{{!}} mode {{!!}} Protection mode
{{!-}}
{{!}} nlink {{!!}} Reference count of hard links
{{!-}}
{{!}} uid {{!!}} User identifier of owner
{{!-}}
{{!}} gid {{!!}} Group identifier of owner
{{!-}}
{{!}} rdev {{!!}} Device identifier (if special file)
{{!-}}
{{!}} size {{!!}} Total file size, in bytes
{{!-}}
{{!}} atime {{!!}} Time of last access as a Unix timestamp
{{!-}}
{{!}} mtime {{!!}} Time of last modification as a Unix timestamp
{{!-}}
{{!}} ctime {{!!}} Time of last status change as a Unix timestamp
{{!-}}
{{!}} type {{!!}} Type of file
{{!}}}
|param1 = path
|param1 = path
|param1text = Path to the file as a string.
|param1text = Path to the file as a string.
Line 306: Line 333:
printf("File size: %s bytes", stat[7]); # prints file size
printf("File size: %s bytes", stat[7]); # prints file size
}}
}}
{| class="wikitable"
! Data !! Meaning
|-
| dev || Identifier of device containing file
|-
| ino || Inode number
|-
| mode || Protection mode
|-
| nlink || Reference count of hard links
|-
| uid || User identifier of owner
|-
| gid || Group identifier of owner
|-
| rdev || Device identifier (if special file)
|-
| size || Total file size, in bytes
|-
| atime || Time of last access as a Unix timestamp
|-
| mtime || Time of last modification as a Unix timestamp
|-
| ctime || Time of last status change as a Unix timestamp
|-
| type || Type of file
|}


=== tell(filehandle) ===
=== tell(filehandle) ===

Navigation menu