A directory in the file system. More...
Public Member Functions | |
| BDirectory () | |
| Creates an uninitialized BDirectory object. | |
| BDirectory (const BDirectory &dir) | |
| Creates a copy of the supplied BDirectory object. | |
| BDirectory (const entry_ref *ref) | |
| Creates a BDirectory and initializes it to the directory referred to by the supplied entry_ref. | |
| BDirectory (const node_ref *nref) | |
| Creates a BDirectory and initializes it to the directory referred to by the supplied node_ref. | |
| BDirectory (const BEntry *entry) | |
| Creates a BDirectory and initializes it to the directory referred to by the supplied BEntry. | |
| BDirectory (const char *path) | |
| Creates a BDirectory and initializes it to the directory referred to by the supplied path name. | |
| BDirectory (const BDirectory *dir, const char *path) | |
| Creates a BDirectory and initializes it to the directory referred to by the supplied path name relative to the specified BDirectory. | |
| virtual | ~BDirectory () |
| Destroys the BDirectory object. | |
| bool | Contains (const char *path, int32 nodeFlags=B_ANY_NODE) const |
| Returns whether or not this directory or any of its subdirectories at any level contain the entry referred to by the supplied path name. | |
| bool | Contains (const BEntry *entry, int32 nodeFlags=B_ANY_NODE) const |
| Returns whether or not this directory or any of its subdirectories at any level contain the entry referred to by the supplied BEntry. | |
| virtual int32 | CountEntries () |
| Returns the number of entries in this directory. | |
| status_t | CreateDirectory (const char *path, BDirectory *dir) |
| Creates a new directory. | |
| status_t | CreateFile (const char *path, BFile *file, bool failIfExists=false) |
| Creates a new file. | |
| status_t | CreateSymLink (const char *path, const char *linkToPath, BSymLink *link) |
| Creates a new symbolic link. | |
| int | Dup () |
| Gets the POSIX file descriptor referred to by this node. | |
| status_t | FindEntry (const char *path, BEntry *entry, bool traverse=false) const |
| Finds an entry referred to by a path relative to the directory represented by this BDirectory. | |
| status_t | GetAccessTime (time_t *atime) const |
| Fills out atime with the access time of the node. | |
| status_t | GetCreationTime (time_t *ctime) const |
| Fills out ctime with the creation time of the node. | |
| status_t | GetEntry (BEntry *entry) const |
| Gets a BEntry object referring to the directory. If the initialization of entry fails, it is Unset(). | |
| status_t | GetGroup (gid_t *group) const |
| Fills out the node's GID into group. | |
| status_t | GetModificationTime (time_t *mtime) const |
| Fills out mtime with the last modification time of the node. | |
| virtual int32 | GetNextDirents (dirent *buf, size_t bufSize, int32 count=INT_MAX) |
| Returns the next entries of the BDirectory object as a pointer to dirent structures. | |
| virtual status_t | GetNextEntry (BEntry *entry, bool traverse=false) |
| Returns the next entry as a BEntry object. | |
| virtual status_t | GetNextRef (entry_ref *ref) |
| Returns the BDirectory's next entry as an entry_ref. | |
| status_t | GetNodeRef (node_ref *ref) const |
Fills out ref with the node_ref of the node. | |
| status_t | GetOwner (uid_t *owner) const |
| Fills out the node's UID into owner. | |
| status_t | GetPermissions (mode_t *perms) const |
| Fills out perms with the permissions of the node. | |
| status_t | GetSize (off_t *size) const |
| Fills out the size of the node's data (not counting attributes) into size. | |
| virtual status_t | GetStat (struct stat *st) const |
Fills in the given stat structure with the stat() information for this object. | |
| status_t | GetStatFor (const char *path, struct stat *st) const |
| Returns the stat structure of the entry referred to by the supplied path name. | |
| status_t | GetVolume (BVolume *vol) const |
| Fills out vol with the the volume that the node lives on. | |
| status_t | InitCheck () const |
| Checks whether the object has been properly initialized or not. | |
| bool | IsDirectory () const |
| Returns whether or not the node is a directory. | |
| bool | IsFile () const |
| Returns whether or not the node is a file. | |
| bool | IsRootDirectory () const |
| Returns whether the directory is the root directory of a volume. | |
| bool | IsSymLink () const |
| Returns whether or not the node is a symbolic link. | |
| BDirectory & | operator= (const BDirectory &dir) |
| Assigns another BDirectory to this BDirectory. | |
| virtual status_t | Rewind () |
| Rewinds the directory iterator. | |
| status_t | SetAccessTime (time_t atime) |
| Sets the node's access time to atime. | |
| status_t | SetCreationTime (time_t ctime) |
| Sets the node's creation time to ctime. | |
| status_t | SetGroup (gid_t group) |
| Sets the node's GID to group. | |
| status_t | SetModificationTime (time_t mtime) |
| Sets the node's last modification time to mtime. | |
| status_t | SetOwner (uid_t owner) |
| Sets the node's UID to owner. | |
| status_t | SetPermissions (mode_t perms) |
| Sets the node's permissions to perms. | |
| status_t | SetTo (const entry_ref *ref) |
| Re-initializes the BDirectory to the directory referred to by the supplied entry_ref. | |
| status_t | SetTo (const node_ref *nref) |
| Re-initializes the BDirectory to the directory referred to by the supplied node_ref. | |
| status_t | SetTo (const BEntry *entry) |
| Re-initializes the BDirectory to the directory referred to by the supplied BEntry. | |
| status_t | SetTo (const char *path) |
| Re-initializes the BDirectory to the directory referred to by the supplied path name. | |
| status_t | SetTo (const BDirectory *dir, const char *path) |
| Re-initializes the BDirectory to the directory referred to by the supplied path name relative to the specified BDirectory. | |
Assignment Methods | |
| void | Unset () |
| Returns the object to an uninitialized state. | |
Locking Methods | |
| status_t | Lock () |
| Attains an exclusive lock on the data referred to by this node so that it may not be modified by any other objects or methods. | |
| status_t | Unlock () |
| Unlocks the date referred to by this node. | |
| status_t | Sync () |
| Immediately performs any pending disk actions on the node. | |
Attribute Methods | |
| ssize_t | WriteAttr (const char *name, type_code type, off_t offset, const void *buffer, size_t length) |
| Writes data from a buffer to an attribute. | |
| ssize_t | ReadAttr (const char *name, type_code type, off_t offset, void *buffer, size_t length) const |
| Reads data from an attribute into buffer. | |
| status_t | RemoveAttr (const char *name) |
| Deletes the attribute given by name. | |
| status_t | RenameAttr (const char *oldName, const char *newName) |
| Moves the attribute given by oldname to newname. | |
| status_t | GetAttrInfo (const char *name, struct attr_info *info) const |
| Fills in the pre-allocated attr_info struct pointed to by info with information about the attribute specified by name. | |
| status_t | GetNextAttrName (char *buffer) |
Copies the name of the attribute into buffer and then advances the pointer to the next attribute. | |
| status_t | RewindAttrs () |
| Resets the object's attribute pointer to the first attribute in the list. | |
| status_t | WriteAttrString (const char *name, const BString *data) |
| Writes the specified string to the specified attribute, clobbering any previous data. | |
| status_t | ReadAttrString (const char *name, BString *result) const |
| Reads the data of the specified attribute into the pre-allocated result. | |
Comparison Methods | |
| bool | operator== (const BNode &node) const |
| Tests whether this and the supplied BNode object are equal. | |
| bool | operator!= (const BNode &node) const |
| Tests whether this and the supplied BNode object are not equal. | |
A directory in the file system.
| BDirectory::BDirectory | ( | const BDirectory & | dir | ) |
Creates a copy of the supplied BDirectory object.
| dir | The BDirectory object to be copied. |
| BDirectory::BDirectory | ( | const entry_ref * | ref | ) |
Creates a BDirectory and initializes it to the directory referred to by the supplied entry_ref.
| ref | The entry_ref that refers to the directory. |
| BDirectory::BDirectory | ( | const node_ref * | nref | ) |
Creates a BDirectory and initializes it to the directory referred to by the supplied node_ref.
| nref | The node_ref that refers to the directory. |
| BDirectory::BDirectory | ( | const BEntry * | entry | ) |
Creates a BDirectory and initializes it to the directory referred to by the supplied BEntry.
| entry | The BEntry that refers to the directory. |
| BDirectory::BDirectory | ( | const char * | path | ) |
Creates a BDirectory and initializes it to the directory referred to by the supplied path name.
| path | The path name of the directory. |
| BDirectory::BDirectory | ( | const BDirectory * | dir, |
| const char * | path | ||
| ) |
Creates a BDirectory and initializes it to the directory referred to by the supplied path name relative to the specified BDirectory.
| dir | The base BDirectory object. |
| path | The path of the directory relative to dir |
| BDirectory::~BDirectory | ( | ) | [virtual] |
Destroys the BDirectory object.
If the BDirectory is properly initialized, the directory's file descriptor is closed.
| bool BDirectory::Contains | ( | const char * | path, |
| int32 | nodeFlags = B_ANY_NODE |
||
| ) | const |
Returns whether or not this directory or any of its subdirectories at any level contain the entry referred to by the supplied path name.
Only entries that match the node flavor specified by nodeFlags are considered.
If the BDirectory is not properly initialized, the method returns false. A non-absolute path is considered relative to the current directory.
true given an absolute path or an unitialized directory. This implementation is not compatible with that behavior. Instead it converts the path into a BEntry and passes it to the other version of Contains().| path | The entry's path name. May be relative to this directory or may be an absolute path. |
| nodeFlags | Any of the following:
|
true if the entry exists and its kind does match nodeFlags and the BDirectory is properly initialized and does contain the entry at any level, false otherwise. | bool BDirectory::Contains | ( | const BEntry * | entry, |
| int32 | nodeFlags = B_ANY_NODE |
||
| ) | const |
Returns whether or not this directory or any of its subdirectories at any level contain the entry referred to by the supplied BEntry.
Only entries that match the node flavor specified by nodeFlags are considered.
true to stay consistent with BeOS 5.| entry | a BEntry referring to the entry |
| nodeFlags | Any of the following:
|
true if the BDirectory is properly initialized and the entry of the matching kind was found, false otherwise. | int32 BDirectory::CountEntries | ( | ) | [virtual] |
Returns the number of entries in this directory.
CountEntries() uses the directory iterator also used by GetNextEntry(), GetNextRef() and GetNextDirents(). It does a Rewind(), iterates through the entries and Rewind()s again. The entries "." and ".." are not counted.
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
Implements BEntryList.
| status_t BDirectory::CreateDirectory | ( | const char * | path, |
| BDirectory * | dir | ||
| ) |
Creates a new directory.
If an entry with the supplied name already exists this method returns an error status code.
| path | The new path name of the directory. May be a relative path to this directory or an absolute path. |
| dir | A pointer to a BDirectory to be initialized to the newly created directory. May be NULL. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL path. |
| B_ENTRY_NOT_FOUND | path does not refer to a possible entry. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_FILE_EXISTS | An entry with that name does already exist. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
Creates a new file.
If a file with the supplied name does already exist, the method fails, unless it is passed false to failIfExists -- in that case the file is truncated to zero size. The new BFile will operate in B_READ_WRITE mode.
| path | The new file's path name. May be relative to this directory or an absolute path. |
| file | A pointer to a BFile to be initialized to the newly created file. May be NULL. |
| failIfExists | Whether or not to fail if the file already exists. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL path. |
| B_ENTRY_NOT_FOUND | path does not refer to a possible entry. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_FILE_EXISTS | A file with that name does already exist and true has been passed for failIfExists. |
| B_IS_A_DIRECTORY | A directory with the supplied name already exists. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
Creates a new symbolic link.
This method fails if an entry with the supplied name already exists.
| path | the new symbolic link's path name. May be relative to this directory or absolute. |
| linkToPath | the path the symbolic link shall point to. |
| link | a pointer to a BSymLink to be initialized to the newly created symbolic link. May be NULL. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL path or linkToPath. |
| B_ENTRY_NOT_FOUND | path does not refer to a possible entry. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_FILE_EXISTS | An entry with that name does already exist. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
| int BNode::Dup | ( | ) | [inherited] |
Gets the POSIX file descriptor referred to by this node.
Remember to call close() on the file descriptor when you're through with it.
Finds an entry referred to by a path relative to the directory represented by this BDirectory.
path may represent an absolute path. If the BDirectory is not properly initialized then the entry is relative to the current directory. If the entry couldn't be found, entry is Unset().
| path | The entry's path name. May be relative to this directory or an absolute path. |
| entry | A pointer to a BEntry to be initialized with the found entry. |
| traverse | Whether or not to follow a symbolic link. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL path or entry. |
| B_ENTRY_NOT_FOUND | Entry not found. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_NAME_TOO_LONG | The supplied path name (path) is too long. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
| B_NOT_A_DIRECTORY | path includes a non-directory. |
| status_t BStatable::GetAccessTime | ( | time_t * | atime | ) | const [inherited] |
Fills out atime with the access time of the node.
| status_t BNode::GetAttrInfo | ( | const char * | name, |
| struct attr_info * | info | ||
| ) | const [inherited] |
Fills in the pre-allocated attr_info struct pointed to by info with information about the attribute specified by name.
| name | the name of the attribute |
| info | the attr_info structure to be filled in |
| B_OK | Everything went fine. |
| B_BAD_VALUE | name is NULL. |
| B_FILE_ERROR | The object is not initialized. |
| B_ENTRY_NOT_FOUND | The node has no attribute name. |
| status_t BStatable::GetCreationTime | ( | time_t * | ctime | ) | const [inherited] |
Fills out ctime with the creation time of the node.
| ctime | A pointer to a time_t variable to be set. |
Gets a BEntry object referring to the directory. If the initialization of entry fails, it is Unset().
| entry | A pointer to the entry that will refer to the directory. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL entry. |
| B_ENTRY_NOT_FOUND | Directory not found. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
| status_t BStatable::GetGroup | ( | gid_t * | group | ) | const [inherited] |
Fills out the node's GID into group.
| group | a pointer to a gid_t variable to be set. |
| status_t BStatable::GetModificationTime | ( | time_t * | mtime | ) | const [inherited] |
Fills out mtime with the last modification time of the node.
| mtime | A pointer to a time_t variable to be set. |
| status_t BNode::GetNextAttrName | ( | char * | buffer | ) | [inherited] |
Copies the name of the attribute into buffer and then advances the pointer to the next attribute.
The name of the node is first copied into buffer, which should be at least B_ATTR_NAME_LENGTH characters long. The copied node name is NUL terminated. Once the name is copied the attribute list pointer is advanced to the next attribute in the list. When GetNextAttrName() reaches the end of the list it returns B_ENTRY_NOT_FOUND.
| buffer | A buffer to copy the name of the attribute into. |
| B_OK | The Attribute name was copied and there are more attribute names to copy. |
| B_BAD_VALUE | passed in buffer is NULL. |
| B_FILE_ERROR | The object is not initialized. |
| B_ENTRY_NOT_FOUND | There are no more attributes, the last attribute name has already been copied. |
| int32 BDirectory::GetNextDirents | ( | dirent * | buf, |
| size_t | bufSize, | ||
| int32 | count = INT_MAX |
||
| ) | [virtual] |
Returns the next entries of the BDirectory object as a pointer to dirent structures.
Unlike GetNextEntry() and GetNextRef(), this method returns also the entries "." and "..".
| buf | A pointer to a buffer filled with dirent structures containing the found entries. |
| bufSize | The size of buf. |
| count | The maximum number of entries to be returned. |
| B_BAD_VALUE | NULL buf. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_NAME_TOO_LONG | The entry's name is too long for the buffer. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
Implements BEntryList.
Returns the next entry as a BEntry object.
Unlike GetNextDirents() this method ignores "." and "..".
| entry | A pointer to a BEntry to be initialized to the found entry |
| traverse | Specifies whether or not to follow a symbolic link. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL entry. |
| B_ENTRY_NOT_FOUND | No more entries found. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
Implements BEntryList.
Returns the BDirectory's next entry as an entry_ref.
Unlike GetNextDirents() this method ignores "." and "..".
| ref | A pointer to an entry_ref to be filled in with the data from the found entry. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL ref. |
| B_ENTRY_NOT_FOUND | No more entries found. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
Implements BEntryList.
| status_t BStatable::GetOwner | ( | uid_t * | owner | ) | const [inherited] |
Fills out the node's UID into owner.
| owner | A pointer to a uid_t to be set. |
| status_t BStatable::GetPermissions | ( | mode_t * | perms | ) | const [inherited] |
Fills out perms with the permissions of the node.
| perms | A pointer to a mode_t variable to be set. |
| status_t BStatable::GetSize | ( | off_t * | size | ) | const [inherited] |
| status_t BNode::GetStat | ( | struct stat * | st | ) | const [virtual, inherited] |
Fills in the given stat structure with the stat() information for this object.
| st | a pointer to a stat structure to be filled in. |
| B_OK | Everything went fine. |
| B_BAD_VALUE,: | NULL st. |
Implements BStatable.
| status_t BDirectory::GetStatFor | ( | const char * | path, |
| struct stat * | st | ||
| ) | const |
Returns the stat structure of the entry referred to by the supplied path name.
| path | The entry's path name. May be relative to this directory or absolute, or NULL to get the directories stat info. |
| st | A pointer to the stat structure to be filled in by this method. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL st. |
| B_ENTRY_NOT_FOUND | Entry not found. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_NAME_TOO_LONG | The supplied path name (path) is too long. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
| B_NOT_A_DIRECTORY | path includes a non-directory. |
| status_t BNode::InitCheck | ( | ) | const [inherited] |
Checks whether the object has been properly initialized or not.
| bool BStatable::IsDirectory | ( | ) | const [inherited] |
Returns whether or not the node is a directory.
true, if the node is properly initialized and is a directory, false otherwise. | bool BStatable::IsFile | ( | ) | const [inherited] |
Returns whether or not the node is a file.
true, if the node is properly initialized and is a file, false otherwise. | bool BDirectory::IsRootDirectory | ( | ) | const |
Returns whether the directory is the root directory of a volume.
true if the BDirectory is properly initialized and represents a root directory of a volume, false otherwise. | bool BStatable::IsSymLink | ( | ) | const [inherited] |
Returns whether or not the node is a symbolic link.
true, if the node is properly initialized and is a symlink, false otherwise. | status_t BNode::Lock | ( | ) | [inherited] |
Attains an exclusive lock on the data referred to by this node so that it may not be modified by any other objects or methods.
| B_OK | Everything went fine. |
| B_FILE_ERROR | The object is not initialized. |
| B_BUSY | The node is already locked. |
| bool BNode::operator!= | ( | const BNode & | node | ) | const [inherited] |
| BDirectory & BDirectory::operator= | ( | const BDirectory & | dir | ) |
Assigns another BDirectory to this BDirectory.
If the passed in BDirectory object is uninitialized, the returned object will be too. Otherwise it will refer to the same directory, unless an error occurs.
| dir | The original BDirectory object. |
| bool BNode::operator== | ( | const BNode & | node | ) | const [inherited] |
| ssize_t BNode::ReadAttr | ( | const char * | attr, |
| type_code | type, | ||
| off_t | offset, | ||
| void * | buffer, | ||
| size_t | len | ||
| ) | const [inherited] |
Reads data from an attribute into buffer.
Reads len bytes of data from the attribute given by name into buffer. type and offset are currently ignored.
| attr | the name of the attribute. |
| type | the type of the attribute (currently ignored). |
| offset | the index from which to read the data (currently ignored). |
| buffer | the buffer for the data to be read. |
| len | the number of bytes to be read. |
| B_BAD_VALUE | attr or buffer is NULL. |
| B_FILE_ERROR | The object is not initialized. |
| B_ENTRY_NOT_FOUND | The node has no attribute attr. |
Reads the data of the specified attribute into the pre-allocated result.
| name | the name of the attribute. |
| result | the BString to be set to the value of the attribute. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | name or result is NULL. |
| B_FILE_ERROR | The object is not initialized. |
| B_ENTRY_NOT_FOUND | The node has no attribute attr. |
| status_t BNode::RemoveAttr | ( | const char * | name | ) | [inherited] |
Deletes the attribute given by name.
| name | the name of the attribute to remove. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | name is NULL. |
| B_FILE_ERROR | The object is not initialized or the node it refers to read only. |
| B_ENTRY_NOT_FOUND | The node has no attribute name. |
| B_NOT_ALLOWED | The node resides on a read only volume. |
| status_t BNode::RenameAttr | ( | const char * | oldname, |
| const char * | newname | ||
| ) | [inherited] |
Moves the attribute given by oldname to newname.
If newname already exists, the data is clobbered.
| oldname | the name of the attribute to be renamed. |
| newname | the new name for the attribute. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | oldname or newname is NULL. |
| B_FILE_ERROR | The object is not initialized or the node it refers to is read only. |
| B_ENTRY_NOT_FOUND | The node has no attribute oldname. |
| B_NOT_ALLOWED | The node resides on a read only volume. |
| status_t BDirectory::Rewind | ( | ) | [virtual] |
Rewinds the directory iterator.
| B_OK | Everything went fine. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
Implements BEntryList.
| status_t BNode::RewindAttrs | ( | ) | [inherited] |
Resets the object's attribute pointer to the first attribute in the list.
| B_OK | Everything went fine. |
| B_FILE_ERROR | Some other error occurred. |
| status_t BStatable::SetAccessTime | ( | time_t | atime | ) | [inherited] |
Sets the node's access time to atime.
| status_t BStatable::SetCreationTime | ( | time_t | ctime | ) | [inherited] |
Sets the node's creation time to ctime.
| ctime | The creation time to set the node to. |
| status_t BStatable::SetGroup | ( | gid_t | group | ) | [inherited] |
Sets the node's GID to group.
| group | The GID to set the node to. |
| status_t BStatable::SetModificationTime | ( | time_t | mtime | ) | [inherited] |
Sets the node's last modification time to mtime.
| mtime | The modification time to set the node to. |
| status_t BStatable::SetOwner | ( | uid_t | owner | ) | [inherited] |
Sets the node's UID to owner.
| owner | The UID to set the node to. |
| status_t BStatable::SetPermissions | ( | mode_t | perms | ) | [inherited] |
Sets the node's permissions to perms.
| perms | The permissions to set the node to. |
Re-initializes the BDirectory to the directory referred to by the supplied entry_ref.
| ref | The entry_ref referring to the directory. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL ref. |
| B_ENTRY_NOT_FOUND | Directory not found. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
Reimplemented from BNode.
Re-initializes the BDirectory to the directory referred to by the supplied node_ref.
| nref | The node_ref referring to the directory. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL nref. |
| B_ENTRY_NOT_FOUND | Directory not found. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
Re-initializes the BDirectory to the directory referred to by the supplied BEntry.
| entry | The BEntry referring to the directory. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL entry. |
| B_ENTRY_NOT_FOUND | Directory not found. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
Reimplemented from BNode.
| status_t BDirectory::SetTo | ( | const char * | path | ) |
Re-initializes the BDirectory to the directory referred to by the supplied path name.
| path | The directory's path name. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL path. |
| B_ENTRY_NOT_FOUND | Directory not found. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_NAME_TOO_LONG | The supplied path name (path) is too long. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
| B_NOT_A_DIRECTORY | path includes a non-directory. |
Reimplemented from BNode.
| status_t BDirectory::SetTo | ( | const BDirectory * | dir, |
| const char * | path | ||
| ) |
Re-initializes the BDirectory to the directory referred to by the supplied path name relative to the specified BDirectory.
| dir | The base directory. |
| path | The directory path name relative to dir. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL dir or path, or path is absolute. |
| B_ENTRY_NOT_FOUND | Directory not found. |
| B_PERMISSION_DENIED | Directory permissions didn't allow operation. |
| B_NO_MEMORY | Insufficient memory for operation. |
| B_NAME_TOO_LONG | The supplied path name (path) is too long. |
| B_LINK_LIMIT | Indicates a cyclic loop within the file system. |
| B_BUSY | A node was busy. |
| B_FILE_ERROR | A general file error. |
| B_NO_MORE_FDS | The application has run out of file descriptors. |
| B_NOT_A_DIRECTORY | path includes a non-directory. |
Reimplemented from BNode.
| status_t BNode::Sync | ( | ) | [inherited] |
Immediately performs any pending disk actions on the node.
| B_OK | Everything went fine. |
| B_FILE_ERROR | Something went wrong. |
| status_t BNode::Unlock | ( | ) | [inherited] |
Unlocks the date referred to by this node.
| B_OK | Everything went fine. |
| B_FILE_ERROR | The object is not initialized. |
| B_BAD_VALUE | The node is not locked. |
| ssize_t BNode::WriteAttr | ( | const char * | attr, |
| type_code | type, | ||
| off_t | offset, | ||
| const void * | buffer, | ||
| size_t | len | ||
| ) | [inherited] |
Writes data from a buffer to an attribute.
Write len bytes of data from buffer to the attribute specified by name after erasing any data that existed previously. The type specified by type is remembered, and may be queried with GetAttrInfo(). The value of offset is currently ignored.
| attr | the name of the attribute. |
| type | the type of the attribute. |
| offset | the index at which to write the data (currently ignored). |
| buffer | the buffer containing the data to be written. |
| len | the number of bytes to be written. |
| B_BAD_VALUE | attr or buffer is NULL. |
| B_FILE_ERROR | The object is not initialized or the node it refers to is read only. |
| B_NOT_ALLOWED | The node resides on a read only volume. |
| B_DEVICE_FULL | Insufficient disk space. |
| B_NO_MEMORY | Insufficient memory to complete the operation. |
Writes the specified string to the specified attribute, clobbering any previous data.
| name | the name of the attribute. |
| data | the BString to be written to the attribute. |
| B_OK | Everything went fine. |
| B_BAD_VALUE | NULL name or data |
| B_FILE_ERROR | The object is not initialized or the node it refers to is read only. |
| B_NOT_ALLOWED | The node resides on a read only volume. |
| B_DEVICE_FULL | Insufficient disk space. |
| B_NO_MEMORY | Insufficient memory to complete the operation. |