Provides the find_directory function. More...
Provides the find_directory function.
Haiku provides a set of directories for applications to use. These can be accessed using the find_directory function. It is very important to use the function at runtime and not hardcode the path, as it may change in future versions of Haiku, and already changed in past ones. Using this function makes your application more future-proof, and makes sure everyone puts data in the same place, which makes the system cleaner and easier to manage.
Note this function can be accessed from C code, to make it easy to use also in ported applications.
| enum directory_which |
Directory constants to use with find_directory.
There are four kind of directories. Volume-local directories exist on each volume. They may be at a different place in each of them, for example the trash location depends on the filesystem. System and common directories are system-wide. They live on only one volume. The difference is system is only meant for internal system management and shouldn't be used by applications. The common directories have a similar hierarchy, and they are ignored when the user disable user add-ons in the boot menu. User directories have a different value depending on the UID of the application calling the function. They are usually located in the user home directory.
Use common directories for system-wide filessuch as drivers. Use user directories for application settings, since each user may want different settings.
| status_t find_directory | ( | directory_which | which, |
| dev_t | volume, | ||
| bool | createIt, | ||
| char * | pathString, | ||
| int32 | length | ||
| ) |
C interface to find_directory.
Fills up to length characters of pathString with the path to which on volume. Creates the directory if it doesn't exists and creqteIt is set.
| status_t find_directory | ( | directory_which | which, |
| BPath * | path, | ||
| bool | createIt = false, |
||
| BVolume * | volume = NULL |
||
| ) |
C++ interface to find_directory.
Set path to which on volume.