Pyro higlevel API
|
Symbolic link handling class. More...
Public Member Functions | |
SymLink () | |
SymLink (const String &cPath, int nOpenMode=O_RDONLY) | |
SymLink (const Directory &cDir, const String &cName, int nOpenMode=O_RDONLY) | |
SymLink (const FileReference &cRef, int nOpenMode=O_RDONLY) | |
SymLink (const FSNode &cNode) | |
SymLink (const SymLink &cNode) | |
virtual | ~SymLink () |
virtual status_t | SetTo (const String &cPath, int nOpenMode=O_RDONLY) |
Open a node using a path. More... | |
virtual status_t | SetTo (const Directory &cDir, const String &cPath, int nOpenMode=O_RDONLY) |
Open a node using a dir/path pair. More... | |
virtual status_t | SetTo (const FileReference &cRef, int nOpenMode=O_RDONLY) |
Open the node referred to by the given os::FileReference. More... | |
virtual status_t | SetTo (const FSNode &cNode) |
Copy another FSNode. More... | |
virtual status_t | SetTo (const SymLink &cLink) |
status_t | ReadLink (String *pcBuffer) |
String | ReadLink () |
status_t | ConstructPath (const Directory &cParent, Path *pcBuffer) |
status_t | ConstructPath (const String &cParent, Path *pcBuffer) |
Public Member Functions inherited from os::FSNode | |
FSNode () | |
Default contructor. More... | |
FSNode (const String &cPath, int nOpenMode=O_RDONLY) | |
Construct a FSNode from a file path. More... | |
FSNode (const Directory &cDir, const String &cName, int nOpenMode=O_RDONLY) | |
Construct a FSNode from directory and a name inside that directory. More... | |
FSNode (const FileReference &cRef, int nOpenMode=O_RDONLY) | |
Construct a FSNode from a file reference. More... | |
FSNode (int nFD) | |
Construct a FSNode from a file descriptor. More... | |
FSNode (const FSNode &cNode) | |
Copy contructor. More... | |
virtual | ~FSNode () |
Destructor. More... | |
virtual status_t | FDChanged (int nNewFD, const struct stat &sStat) |
virtual status_t | SetTo (int nFD) |
Make the FSNode represent an already open file. More... | |
virtual void | Unset () |
Reset the FSNode. More... | |
virtual bool | IsValid () const |
Check if the node has been properly initialized. More... | |
virtual status_t | GetStat (struct stat *psStat, bool bUpdateCache=true) const |
virtual ino_t | GetInode () const |
virtual dev_t | GetDev () const |
virtual int | GetMode (bool bUpdateCache=false) const |
virtual off_t | GetSize (bool bUpdateCache=true) const |
virtual time_t | GetCTime (bool bUpdateCache=true) const |
virtual time_t | GetMTime (bool bUpdateCache=true) const |
virtual time_t | GetATime (bool bUpdateCache=true) const |
bool | IsDir () const |
bool | IsLink () const |
bool | IsFile () const |
bool | IsCharDev () const |
bool | IsBlockDev () const |
bool | IsFIFO () const |
virtual status_t | GetNextAttrName (String *pcName) |
Read the node's attribute directory. More... | |
virtual status_t | RewindAttrdir () |
Reset the attribute directory iterator. More... | |
virtual ssize_t | WriteAttr (const String &cAttrName, int nFlags, int nType, const void *pBuffer, off_t nPos, size_t nLen) |
Add/update an attribute. More... | |
virtual ssize_t | ReadAttr (const String &cAttrName, int nType, void *pBuffer, off_t nPos, size_t nLen) |
Read the data held by an attribute. More... | |
virtual status_t | RemoveAttr (const String &cName) |
Remove an attribute from an FS node. More... | |
virtual status_t | StatAttr (const String &cName, struct::attr_info *psBuffer) |
Get extended info about an attribute. More... | |
virtual int | GetFileDescriptor () const |
SymLink::SymLink | ( | ) |
SymLink::SymLink | ( | const String & | cPath, |
int | nOpenMode = O_RDONLY |
||
) |
References os::FSNode::GetMode().
References os::FSNode::GetMode().
SymLink::SymLink | ( | const FileReference & | cRef, |
int | nOpenMode = O_RDONLY |
||
) |
References os::FSNode::GetMode().
SymLink::SymLink | ( | const FSNode & | cNode | ) |
References os::FSNode::GetMode().
SymLink::SymLink | ( | const SymLink & | cNode | ) |
|
virtual |
References os::Directory::GetPath().
Referenced by os::FileReference::FileReference(), and os::IconDirectoryView::Invoked().
References os::Path::Append(), os::String::c_str(), and ReadLink().
status_t SymLink::ReadLink | ( | String * | pcBuffer | ) |
References os::FSNode::GetFileDescriptor(), and os::String::resize().
String SymLink::ReadLink | ( | ) |
Referenced by ConstructPath().
|
virtual |
The path can start with "~/" to make it relative to the current users home directory or it can start with "^/" to make it relative to the directory where the executable our application was started from lives in. This path expansion is performed by the os::FSNode class itself and is not part of the low-level filesystem.
The nOpenMode
should be a compination of any of the O_* flags defined in <fcntl.h>. Their meaning is the same as when opening a file with the open() POSIX function except you can not create a file by setting the O_CREAT flag.
The following flags are accepted:
cPath
don't point at a directorycPath
points at a symlinkcPath | Path pointing at the node to open. |
nOpenMode | Flags controlling how to open the node. |
Reimplemented from os::FSNode.
References os::errno_exception::error(), and os::FSNode::FSNode().
Referenced by os::Directory::CreateSymlink(), and SetTo().
|
virtual |
The path can eighter be absolute (cDir
will then be ignored) or it can be relative to cDir
. This have much the same semantics as setting the current working directory to cDir
and then open the node by calling SetTo( const String& cPath, int nOpenMode ) with the path. The main advantage with this function is that it is thread-safe. You don't get any races while temporarily changing the current working directory.
For a more detailed description look at: SetTo( const String& cPath, int nOpenMode )
cDir | A valid directory from which the cPath is relative to. |
cPath | The file path relative to cDir . The path can eighter be absoulute (in which case cDir is ignored) or it can be relative to cDir . |
nOpenMode | Flags controlling how to open the node. See SetTo( const String& cPath, int nOpenMode ) for a full description of the various flags. |
Reimplemented from os::FSNode.
References os::errno_exception::error(), os::FSNode::FSNode(), and SetTo().
|
virtual |
Reimplemented from os::FSNode.
References os::errno_exception::error(), os::FSNode::FSNode(), and SetTo().
|
virtual |
cNode
. cNode | The FSNode to copy. |
Reimplemented from os::FSNode.
References os::FSNode::GetMode(), and os::FSNode::SetTo().
|
virtual |
References os::FSNode::SetTo().