HomeForumsWhat's newResources 
 
 
move into directories
vbt - Jul 1, 2012
   vbt Jul 1, 2012 
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 ?

   antime Jul 1, 2012 
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).

   vbt Jul 8, 2012 

  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,0x0
0,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);

   antime Jul 8, 2012 
Can you post the surrounding code?