move into directories

vbt

Staff member
i'm having some troubles with cdc/gfs to return to parent directory or at least root folder. Anybody know a proper way to do that ?
 
The CDC documentation says that calling CDC_ChgDir with a file id of CDC_NUL_FID will return to the root. The first and second file entries in each directory should be a reference to self and the parent, respectively (ie. the "." and ".." used in most file systems). Looking at the GFS sources both of these appear to work there too. In GFS_DIR.C file id 1 is hardcoded to equate with the parent directory, and there's a private helper function called GFDR_ChgRoot() which simply returns GFDR_ChgDir(CDC_NUL_FID).
 
antime said:
The CDC documentation says that calling CDC_ChgDir with a file id of CDC_NUL_FID will return to the root. The first and second file entries in each directory should be a reference to self and the parent, respectively (ie. the "." and ".." used in most file systems). Looking at the GFS sources both of these appear to work there too. In GFS_DIR.C file id 1 is hardcoded to equate with the parent directory, and there's a private helper function called GFDR_ChgRoot() which simply returns GFDR_ChgDir(CDC_NUL_FID).

Thanks Antime, I tried everything and nothing works. I'm forced to use another cdinit :

CDC_CdInit(0x00,0x00,0x05,0x0f);

GFS_DIRTBL_TYPE(&dirtbl) = GFS_DIR_NAME;

GFS_DIRTBL_DIRNAME(&dirtbl) = dir_name;

GFS_DIRTBL_NDIR(&dirtbl) = MAX_DIR;

GFS_Init(MAX_OPEN, lib_work, &dirtbl);
 
Back
Top