xref: /haiku/src/tests/system/libroot/os/FindDirectoryTest.cpp (revision 2f470aec1c92ce6917b8a903e343795dc77af41f)
1 /*
2  * Copyright (c) 2004, François Revol.
3  * Distributed under the terms of the MIT license.
4  */
5 
6 
7 #include <FindDirectory.h>
8 #include <fs_info.h>
9 
10 #include <stdio.h>
11 
12 
13 int
14 main(int argc, char **argv)
15 {
16 	dev_t dev = -1;
17 
18 	if (argc > 1)
19 		dev = dev_for_path(argv[1]);
20 
21 	for (int32 i = B_DESKTOP_DIRECTORY; i < B_UTILITIES_DIRECTORY; i++) {
22 		char buffer[B_PATH_NAME_LENGTH];
23 		status_t err = find_directory((directory_which)i, dev, false, buffer, B_PATH_NAME_LENGTH);
24 		if (err)
25 			continue;
26 
27 		printf("dir[%04ld] = '%s'\n", i, buffer);
28 	}
29 	return 0;
30 }
31 
32