Loading...
Searching...
No Matches
Public Member Functions | List of all members
BDirectory Class Reference

A directory in the file system. More...

Inherits BNode, and BEntryList.

Public Member Functions

 BDirectory ()
 Creates an uninitialized BDirectory object.
 
 BDirectory (const BDirectory &dir)
 Creates a copy of the supplied BDirectory object.
 
 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.
 
 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 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.
 
virtual ~BDirectory ()
 Destroys the BDirectory object.
 
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.
 
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.
 
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.
 
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 GetEntry (BEntry *entry) const
 Gets a BEntry object referring to the directory. If the initialization of entry fails, it is Unset().
 
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 GetStatFor (const char *path, struct stat *st) const
 Returns the stat structure of the entry referred to by the supplied path name.
 
bool IsRootDirectory () const
 Returns whether the directory is the root directory of a volume.
 
BDirectoryoperator= (const BDirectory &dir)
 Assigns another BDirectory to this BDirectory.
 
virtual status_t Rewind ()
 Rewinds the directory iterator.
 
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.
 
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 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.
 
- Public Member Functions inherited from BNode
 BNode ()
 Creates an uninitialized BNode object.
 
 BNode (const BDirectory *dir, const char *path)
 Creates a BNode object and initializes it to the entry referred to by the specified path rooted in the specified directory.
 
 BNode (const BEntry *entry)
 Creates a BNode object and initializes it to the specified filesystem entry.
 
 BNode (const BNode &node)
 Creates a copy of the given BNode.
 
 BNode (const char *path)
 Creates a BNode object and initializes it to the entry referred to by the specified path.
 
 BNode (const entry_ref *ref)
 Creates a BNode object and initializes it to the specified entry_ref.
 
virtual ~BNode ()
 Frees all resources associated with the BNode.
 
int Dup ()
 Gets the POSIX file descriptor referred to by this node.
 
virtual status_t GetStat (struct stat *st) const
 Fills in the given stat structure with the stat() information for this object.
 
status_t InitCheck () const
 Checks whether the object has been properly initialized or not.
 
status_t SetTo (const entry_ref *ref)
 Initializes the object to the specified entry_ref.
 
status_t SetTo (const BEntry *entry)
 Initializes the object to the specified filesystem entry.
 
status_t SetTo (const char *path)
 Initializes the object to the specified path.
 
status_t SetTo (const BDirectory *dir, const char *path)
 Initializes the object to the entry referred by the specified path relative to the the specified directory.
 
void Unset ()
 Returns the object to an uninitialized state.
 
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.
 
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.
 
BNodeoperator= (const BNode &node)
 Initializes the object as a copy of other.
 
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.
 
- Public Member Functions inherited from BStatable
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 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.
 
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 *permissions) 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 *stat) const =0
 Fills out the stat structure for the node.
 
status_t GetVolume (BVolume *volume) const
 Fills out vol with the the volume that the node lives on.
 
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 IsSymLink () const
 Returns whether or not the node is a symbolic link.
 
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 permissions)
 Sets the node's permissions to perms.
 
- Public Member Functions inherited from BEntryList
 BEntryList ()
 Creates a BEntryList object.
 
virtual ~BEntryList ()
 Frees all resources associated with the BEntryList object.
 
virtual int32 CountEntries ()=0
 Returns the number of entries in the list.
 
virtual int32 GetNextDirents (struct dirent *direntBuffer, size_t bufferSize, int32 maxEntries=INT_MAX)=0
 Returns the BEntryList's next entries as dirent structures.
 
virtual status_t GetNextEntry (BEntry *entry, bool traverse=false)=0
 Returns the BEntryList's next entry as a BEntry.
 
virtual status_t GetNextRef (entry_ref *ref)=0
 Returns the BEntryList's next entry as an entry_ref.
 
virtual status_t Rewind ()=0
 Rewinds the list pointer to the beginning of the list.
 

Detailed Description

A directory in the file system.

Since
BeOS R3

Constructor & Destructor Documentation

◆ BDirectory() [1/7]

BDirectory::BDirectory ( )

Creates an uninitialized BDirectory object.

Since
BeOS R3

◆ BDirectory() [2/7]

BDirectory::BDirectory ( const BDirectory dir)

Creates a copy of the supplied BDirectory object.

Parameters
dirThe BDirectory object to be copied.
Since
BeOS R3

◆ BDirectory() [3/7]

BDirectory::BDirectory ( const entry_ref ref)

Creates a BDirectory and initializes it to the directory referred to by the supplied entry_ref.

Parameters
refThe entry_ref that refers to the directory.
Since
BeOS R3

◆ BDirectory() [4/7]

BDirectory::BDirectory ( const node_ref nref)

Creates a BDirectory and initializes it to the directory referred to by the supplied node_ref.

Parameters
nrefThe node_ref that refers to the directory.
Since
BeOS R3

◆ BDirectory() [5/7]

BDirectory::BDirectory ( const BEntry entry)

Creates a BDirectory and initializes it to the directory referred to by the supplied BEntry.

Parameters
entryThe BEntry that refers to the directory.
Since
BeOS R3

◆ BDirectory() [6/7]

BDirectory::BDirectory ( const char *  path)

Creates a BDirectory and initializes it to the directory referred to by the supplied path name.

Parameters
pathThe path name of the directory.
Since
BeOS R3

◆ BDirectory() [7/7]

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.

Parameters
dirThe base BDirectory object.
pathThe path of the directory relative to dir
Since
BeOS R3

◆ ~BDirectory()

BDirectory::~BDirectory ( )
virtual

Destroys the BDirectory object.

If the BDirectory is properly initialized, the directory's file descriptor is closed.

Since
BeOS R3

Member Function Documentation

◆ Contains() [1/2]

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.

Note
If the paths are identical, this method returns true to stay consistent with BeOS 5.
Parameters
entrya BEntry referring to the entry
nodeFlagsAny of the following:
  • B_FILE_NODE: The entry must be a file.
  • B_DIRECTORY_NODE: The entry must be a directory.
  • B_SYMLINK_NODE: The entry must be a symbolic link.
  • B_ANY_NODE: The entry may be of any kind.
Returns
true if the BDirectory is properly initialized and the entry of the matching kind was found, false otherwise.
Since
BeOS R3

◆ Contains() [2/2]

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.

Note
BeOS R5's implementation always returns true given an absolute path or an initialized 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().
Parameters
pathThe entry's path name. May be relative to this directory or may be an absolute path.
nodeFlagsAny of the following:
  • B_FILE_NODE: The entry must be a file.
  • B_DIRECTORY_NODE: The entry must be a directory.
  • B_SYMLINK_NODE: The entry must be a symbolic link.
  • B_ANY_NODE: The entry may be of any kind.
Returns
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.
Since
BeOS R3

◆ CountEntries()

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.

Returns
The number of entries in the directory (not counting "." and "..") or a status code on error.
Return values
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
See also
BDirectory::GetNextEntry()
BDirectory::GetNextRef()
BDirectory::GetNextDirents()
BDirectory::Rewind()
Since
BeOS R3

Implements BEntryList.

◆ CreateDirectory()

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.

Parameters
pathThe new path name of the directory. May be a relative path to this directory or an absolute path.
dirA pointer to a BDirectory to be initialized to the newly created directory. May be NULL.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL path.
B_ENTRY_NOT_FOUNDpath does not refer to a possible entry.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_FILE_EXISTSAn entry with that name does already exist.
B_NO_MORE_FDSThe application has run out of file descriptors.
Since
BeOS R3

◆ CreateFile()

status_t BDirectory::CreateFile ( const char *  path,
BFile file,
bool  failIfExists = false 
)

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.

Parameters
pathThe new file's path name. May be relative to this directory or an absolute path.
fileA pointer to a BFile to be initialized to the newly created file. May be NULL.
failIfExistsWhether or not to fail if the file already exists.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL path.
B_ENTRY_NOT_FOUNDpath does not refer to a possible entry.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_FILE_EXISTSA file with that name does already exist and true has been passed for failIfExists.
B_IS_A_DIRECTORYA directory with the supplied name already exists.
B_NO_MORE_FDSThe application has run out of file descriptors.
Since
BeOS R3

◆ CreateSymLink()

status_t BDirectory::CreateSymLink ( const char *  path,
const char *  linkToPath,
BSymLink link 
)

Creates a new symbolic link.

This method fails if an entry with the supplied name already exists.

Parameters
paththe new symbolic link's path name. May be relative to this directory or absolute.
linkToPaththe path the symbolic link shall point to.
linka pointer to a BSymLink to be initialized to the newly created symbolic link. May be NULL.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL path or linkToPath.
B_ENTRY_NOT_FOUNDpath does not refer to a possible entry.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_FILE_EXISTSAn entry with that name does already exist.
B_NO_MORE_FDSThe application has run out of file descriptors.
Since
BeOS R3

◆ FindEntry()

status_t BDirectory::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.

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().

Note
The functionality of this method differs from BEntry::SetTo(BDirectory *, const char *, bool) in that it doesn't require the entry to exist, whereas this method does.
Parameters
pathThe entry's path name. May be relative to this directory or an absolute path.
entryA pointer to a BEntry to be initialized with the found entry.
traverseWhether or not to follow a symbolic link.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL path or entry.
B_ENTRY_NOT_FOUNDEntry not found.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_NAME_TOO_LONGThe supplied path name (path) is too long.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
B_NOT_A_DIRECTORYpath includes a non-directory.
See also
BEntry::SetTo(BDirectory *, const char *, bool)
Since
BeOS R3

◆ GetEntry()

status_t BDirectory::GetEntry ( BEntry entry) const

Gets a BEntry object referring to the directory. If the initialization of entry fails, it is Unset().

Parameters
entryA pointer to the entry that will refer to the directory.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL entry.
B_ENTRY_NOT_FOUNDDirectory not found.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
Since
BeOS R3

◆ GetNextDirents()

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 "..".

Note
The iterator used by this method is the same one used by GetNextEntry(), GetNextRef(), Rewind() and CountEntries().
Parameters
bufA pointer to a buffer filled with dirent structures containing the found entries.
bufSizeThe size of buf.
countThe maximum number of entries to be returned.
Returns
The number of dirent structures stored in the buffer, 0 when there are no more entries to be returned or a status code on error.
Return values
B_BAD_VALUENULL buf.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_NAME_TOO_LONGThe entry's name is too long for the buffer.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
Since
BeOS R3

Implements BEntryList.

◆ GetNextEntry()

status_t BDirectory::GetNextEntry ( BEntry entry,
bool  traverse = false 
)
virtual

Returns the next entry as a BEntry object.

Unlike GetNextDirents() this method ignores "." and "..".

Note
The iterator used by this method is the same one used by GetNextRef(), GetNextDirents(), Rewind() and CountEntries().
Parameters
entryA pointer to a BEntry to be initialized to the found entry
traverseSpecifies whether or not to follow a symbolic link.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL entry.
B_ENTRY_NOT_FOUNDNo more entries found.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
Since
BeOS R3

Implements BEntryList.

◆ GetNextRef()

status_t BDirectory::GetNextRef ( entry_ref ref)
virtual

Returns the BDirectory's next entry as an entry_ref.

Unlike GetNextDirents() this method ignores "." and "..".

Note
The iterator used be this method is the same one used by GetNextEntry(), GetNextDirents(), Rewind() and CountEntries().
Parameters
refA pointer to an entry_ref to be filled in with the data from the found entry.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL ref.
B_ENTRY_NOT_FOUNDNo more entries found.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
Since
BeOS R3

Implements BEntryList.

◆ GetStatFor()

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.

Parameters
pathThe entry's path name. May be relative to this directory or absolute, or NULL to get the directories stat info.
stA pointer to the stat structure to be filled in by this method.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL st.
B_ENTRY_NOT_FOUNDEntry not found.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_NAME_TOO_LONGThe supplied path name (path) is too long.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
B_NOT_A_DIRECTORYpath includes a non-directory.
Since
BeOS R3

◆ IsRootDirectory()

bool BDirectory::IsRootDirectory ( ) const

Returns whether the directory is the root directory of a volume.

Returns
true if the BDirectory is properly initialized and represents a root directory of a volume, false otherwise.
Since
BeOS R3

◆ operator=()

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.

Parameters
dirThe original BDirectory object.
Returns
A reference to this BDirectory object.
Since
BeOS R3

◆ Rewind()

status_t BDirectory::Rewind ( )
virtual

Rewinds the directory iterator.

Returns
A status code.
Return values
B_OKEverything went fine.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
See also
BDirectory::GetNextEntry()
BDirectory::GetNextRef()
BDirectory::GetNextDirents()
BDirectory::CountEntries()
Since
BeOS R3

Implements BEntryList.

◆ SetTo() [1/5]

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.

Parameters
dirThe base directory.
pathThe directory path name relative to dir.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL dir or path, or path is absolute.
B_ENTRY_NOT_FOUNDDirectory not found.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_NAME_TOO_LONGThe supplied path name (path) is too long.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
B_NOT_A_DIRECTORYpath includes a non-directory.
Since
BeOS R3

◆ SetTo() [2/5]

status_t BDirectory::SetTo ( const BEntry entry)

Re-initializes the BDirectory to the directory referred to by the supplied BEntry.

Parameters
entryThe BEntry referring to the directory.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL entry.
B_ENTRY_NOT_FOUNDDirectory not found.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
Since
BeOS R3

◆ SetTo() [3/5]

status_t BDirectory::SetTo ( const char *  path)

Re-initializes the BDirectory to the directory referred to by the supplied path name.

Parameters
pathThe directory's path name.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL path.
B_ENTRY_NOT_FOUNDDirectory not found.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_NAME_TOO_LONGThe supplied path name (path) is too long.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
B_NOT_A_DIRECTORYpath includes a non-directory.
Since
BeOS R3

◆ SetTo() [4/5]

status_t BDirectory::SetTo ( const entry_ref ref)

Re-initializes the BDirectory to the directory referred to by the supplied entry_ref.

Parameters
refThe entry_ref referring to the directory.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL ref.
B_ENTRY_NOT_FOUNDDirectory not found.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
Since
BeOS R3

◆ SetTo() [5/5]

status_t BDirectory::SetTo ( const node_ref nref)

Re-initializes the BDirectory to the directory referred to by the supplied node_ref.

Parameters
nrefThe node_ref referring to the directory.
Returns
A status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL nref.
B_ENTRY_NOT_FOUNDDirectory not found.
B_PERMISSION_DENIEDDirectory permissions didn't allow operation.
B_NO_MEMORYInsufficient memory for operation.
B_LINK_LIMITIndicates a cyclic loop within the file system.
B_BUSYA node was busy.
B_FILE_ERRORA general file error.
B_NO_MORE_FDSThe application has run out of file descriptors.
Since
BeOS R3