[En-Nut-Discussion] Question about the Peanut filesystem

Jesper Hansen jesperh at telia.com
Thu Jan 12 20:20:12 CET 2006


Apropos Current Directory......

I have recently used NutOs in an application where there was a need for 
keeping a current directory, which may be unique for the various threads.

I added these two fields to the _NUTTHREADINFO struct :

   void * td_drive;
   u_long td_dircluster;

td_drive is a pointer to the NUTDEVICE struct for the current drive, and 
obviusly, td_dircluster to to current direcoty cluster on the drive.

mkdir, chdir, fatinit e.t.c sets these and the FAT functions that 
require a NUTDEVICE pointer, I simply use 
(NUTDEVICE*)runningThread->td_drive instead.

Works like a dream.

/Jesper



More information about the En-Nut-Discussion mailing list