Documentation | StorageKit | Statable
SYNOPSIS
Perl
use HaikuR1::Statable; my $stat = $statable->GetStat();
Python
from HaikuR1.StorageKit import Statable stat = statable.GetStat();
DESCRIPTION
Exposes the BStatable
object.
For more information on Statable, see the Be Book class description, the Be Book overview, and the Haiku Book class description.
Note that Statable is an abstract object, so there is no constructor. Given that the target languages (Perl and Python) have their own facilities for finding this information, you may not find this function very useful. However, it is the base class for Node, so it has been implemented.
METHODS
Flavor
IsFile
IsDirectory
IsSymLink
These methods do what you expect.
Perl
$statable->IsFile(); $statable->IsDirectory(); $statable->IsSymLink();
Python
statable.IsFile() statable.IsDirectory() statable.IsSymLink()
GetNodeRef
Returns a dict with two members, device
and node
, whose values are
integer ids.
Perl
$statable->GetNodeRef();
Python
statable.GetNodeRef()
GetStat
Returns a native map containing information about the node.
st_dev
device idst_ino
node idst_mode
flavorst_nlink
number of hard linksst_uid
owner idst_gid
group idst_size
size in bytesst_rdev
device type (provided for System V compatibility)st_blksize
preferred block sizest_atim
time mapst_mtim
time mapst_ctim
time mapst_crtim
time mapst_type
attribute/index typest_blocks
number of blocka allocated
A time map is a native map containing the following fields:
tv_sec
number of secondstv_nsec
number of nanoseconds
Perl
$statable->GetStat();
Python
statable.GetStat()
GetVolume
Returns a Volume object representing the volume that contains the node.
Perl
$statable->GetVolume();
Python
statable.GetVolume()
Properties
GetOwner
SetOwner
GetGroup
SetGroup
GetPermissions
SetPermissions
GetSize
GetModificationTime
SetModificationTime
GetCreationTime
SetCreationTime
GetAccessTime
SetAccessTime
These methods do what you expect.
Perl
$statable->GetOwner(); $statable->SetOwner($owner); $statable->GetGroup(); $statable->SetGroup($group); $statable->GetPermissions(); $statable->SetPermissions($perms); $statable->GetSize(); $statable->GetModificationTime(); $statable->SetModificationTime($time); $statable->GetCreationTime(); $statable->SetCreationTime($time); $statable->GetAccessTime(); $statable->SetAccessTime($time);
Python
statable.GetOwner() statable.SetOwner(owner) statable.GetGroup() statable.SetGroup(group) statable.GetPermissions() statable.SetPermissions(perms) statable.GetSize() statable.GetModificationTime() statable.SetModificationTime(time) statable.GetCreationTime() statable.SetCreationTime(time) statable.GetAccessTime() statable.SetAccessTime(time)
owner
An integer user id.
group
An integer group id.
perms
An integer representing standard POSIX permissions.
time
An integer, the number of seconds since 1 Jan 1970.