StRoot
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
RTS
src
SFS
sfs_single.C
1
#include <sfs_index.h>
2
#include <stdio.h>
3
#include <rtsLog.h>
4
5
//extern int debug;
6
7
int
main(
int
argc,
char
*argv[])
8
{
9
//rtsLogOutput(2);
10
//rtsLogLevel(DBG);
11
12
if
(argc < 2) {
13
printf(
"Need a filename\n"
);
14
exit(0);
15
}
16
17
18
sfs_index
sfs;
19
//debug = 0;
20
int
ret = sfs.mountSingleDir(argv[1]);
21
//int ret = sfs.mountSingleDir(argv[1], 2147451904);
22
if
(ret < 0) {
23
printf(
"Error mounting %s"
,argv[1]);
24
return
-1;
25
}
26
27
do
{
28
printf(
"Mounting new directory:\n"
);
29
30
// fs_dirent *ent;
31
fs_dir
*dir = sfs.opendir(
"/"
);
32
if
(dir) {
33
fs_filelist
list;
34
sfs.mem_ls(&list, 1, dir);
35
for
(
int
i=0;i<list.n;i++) {
36
printf(
":::%s\n"
,list.filename[i]);
37
}
38
39
sfs.closedir(dir);
40
}
41
else
{
42
printf(
"no rootdir?\n"
);
43
}
44
45
ret = sfs.mountNextDir();
46
printf(
"mountnextdir() ret=%d\n"
,ret);
47
}
while
(ret > 0);
48
49
50
}
51
52
53
fs_filelist
Definition:
fs_index.h:86
sfs_index
Definition:
sfs_index.h:129
fs_dir
Definition:
fs_index.h:34
Generated by
1.8.5