PackageC.sys.stat
Classpublic class status
Inheritancestatus Inheritance Object

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

The status class (stat structure) contains information about a file.

The informations will be different depending on the operating system (linux and macintosh vs windows) and depending on the file system (FAT, HPFS, NTFS, etc.).

By itself this class does nothing, you need to create an instance and pass it by reference to one of the stat() functions so the native call can fill in the data structure with the different file informations.

View the examples

See also

stat()


Public Properties
 PropertyDefined By
  AVM-only st_atime : Number
Last data access timestamp.
status
  AVM-only st_ctime : Number
Last file status change timestamp.
status
  AVM-only st_dev : int
Device ID of device containing file.
status
  AVM-only st_gid : int
Group ID of file.
status
  AVM-only st_ino : uint
File serial number.
status
  AVM-only st_mode : int
Mode of file (see below).
status
  AVM-only st_mtime : Number
Last data modification timestamp.
status
  AVM-only st_nlink : int
Number of hard links to the file.
status
  AVM-only st_rdev : int
Device ID (if file is character or block special).
status
  AVM-only st_size : Number
For regular files, the file size in bytes.
status
  AVM-only st_uid : int
User ID of file.
status
Public Methods
 MethodDefined By
 Inherited
_init():*
[static]
_init
 Inherited
AS3
 Inherited
init():*
[static]
init
 Inherited
AS3
 Inherited
AS3
  
status
Protected Methods
 MethodDefined By
 Inherited
[static]
protected
 Inherited
_setPropertyIsEnumerable(o:*, V:String, enumerable:Boolean):void
[static]
protected
Public Constants
 ConstantDefined By
 Inheritedlength : int = 1
[static]
length
Property Detail
AVM-only st_atimeproperty
public var st_atime:Number

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

Last data access timestamp.

Note: For Windows, Time of last access of file. Valid on NTFS but not on FAT formatted disk drives.

Attention: here the time value is represented in seconds, if you need to convert to a Date object you will have to multiply by 1000 to convert the value to milliseconds.

AVM-only st_ctimeproperty 
public var st_ctime:Number

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

Last file status change timestamp.

Note: For Windows, Time of creation of file. Valid on NTFS but not on FAT formatted disk drives.

Attention: here the time value is represented in seconds, if you need to convert to a Date object you will have to multiply by 1000 to convert the value to milliseconds.

AVM-only st_devproperty 
public var st_dev:int

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

Device ID of device containing file.

Note: For Windows, Drive number of the disk containing the file (same as st_rdev).

AVM-only st_gidproperty 
public var st_gid:int

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

Group ID of file.

Note: For Windows, Numeric identifier of group that owns the file (UNIX-specific). This field will always be zero on Windows systems. A redirected file is classified as a Windows file.

AVM-only st_inoproperty 
public var st_ino:uint

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

File serial number.

Note: For Windows, Number of the information node (the inode) for the file (UNIX-specific). On UNIX file systems, the inode describes the file date and time stamps, permissions, and content. When files are hard-linked to one another, they share the same inode. The inode, and therefore st_ino, has no meaning in the FAT, HPFS, or NTFS file systems.

AVM-only st_modeproperty 
public var st_mode:int

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

Mode of file (see below).

Note: For Windows, Bit mask for file-mode information. The S_IFDIR bit is set if path specifies a directory; the S_IFREG bit is set if path specifies an ordinary file or a device. User read/write bits are set according to the file's permission mode; user execute bits are set according to the filename extension.

AVM-only st_mtimeproperty 
public var st_mtime:Number

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

Last data modification timestamp.

Note: For Windows, Time of last modification of file.

Attention: here the time value is represented in seconds, if you need to convert to a Date object you will have to multiply by 1000 to convert the value to milliseconds.


Example
Time convertion
         var info:status = new status();
         var result:int = stat( "somefile", info );
         
         var modified:Date = new Date();
             modified.setTime( info.st_mtime * 1000 );
         
AVM-only st_nlinkproperty 
public var st_nlink:int

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

Number of hard links to the file.

Note: For Windows, Always 1 on non-NTFS file systems.

AVM-only st_rdevproperty 
public var st_rdev:int

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

Device ID (if file is character or block special).

Note: For Windows, Drive number of the disk containing the file (same as st_dev).

AVM-only st_sizeproperty 
public var st_size:Number

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

For regular files, the file size in bytes.

Note: For Windows, Size of the file in bytes; a 64-bit integer for variations with the i64 suffix.

AVM-only st_uidproperty 
public var st_uid:int

Language Version : ActionScript 3.0
Runtime Versions : RedTamarin 0.4

User ID of file.

Note: For Windows, Numeric identifier of user who owns file (UNIX-specific). This field will always be zero on Windows systems. A redirected file is classified as a Windows file.

Method Detail
toString()method
public function toString():String

Returns
String
Examples
Usage
      import C.sys.stat.*;
      
      // create an instance
      var info:status = new status();
      
      // now pass it by reference
      stat( "/etc/myfile", info );
      
      // after that, you can access the file informations
      trace( "file size = " + info.st_size + " bytes" );