TAP_Hdd_ChangeDir

Topfield Documentation

word TAP_Hdd_ChangeDir( char *dir )

It changes the current directory into the specified directory. The path must be relative to the current directory.

  • dir : directory name. In case of '..', it is the parent directory. For '/', it is ROOT directory.

Additional Documentation

In firmware before 5.12.00 the return values are

  • 0 = success
  • non zero = failure
In firmares 5.12.00 onwards
  • 0 = failure
  • non zere = success
Using '/' at the beginning to specify the root directory does not work. Using just "/" as a directory seems to be working but if you do that in a tap that's being started from AutoStart -folder it will break all taps being loaded after it.

TAP_Hdd_ChangeDir is not Transactional - if the call fails there is no guarentee that the current directory is the same as it was before you made the call - in fact you will end up with the current directory being the closest valid parent directory of the directory you asked for.

To get to the root directory you can use following code:

TYPE_File f;

while (TAP_Hdd_FindFirst(&f) && !strcmp(f.name, ".")) TAP_Hdd_ChangeDir("..");