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_devdevice idst_inonode idst_modeflavorst_nlinknumber of hard linksst_uidowner idst_gidgroup idst_sizesize in bytesst_rdevdevice type (provided for System V compatibility)st_blksizepreferred block sizest_atimtime mapst_mtimtime mapst_ctimtime mapst_crtimtime mapst_typeattribute/index typest_blocksnumber of blocka allocated
A time map is a native map containing the following fields:
tv_secnumber of secondstv_nsecnumber 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)
ownerAn integer user id.
groupAn integer group id.
permsAn integer representing standard POSIX permissions.
timeAn integer, the number of seconds since 1 Jan 1970.