When an application is loaded from a file, it automatically gets its current directory set to where the program file is located. This makes it easier for the new task to find any files it needs.
The File folio provides two calls, GetDirectory()
and ChangeDirectory(),
to determine and change the location of the current directory of the current task.
GetDirectory()
returns the item number of the current directory of the calling task.
Item GetDirectory( char *pathBuf, int32 pathBufLen )
pathBuf
is non-NULL, it points to a buffer of writable memory whose length is given in pathBufLen
; the absolute pathname of the current working directory is stored into this buffer.
ChangeDirectory()
changes the current directory of the current task to the absolute or relative location specified by the path.
Item ChangeDirectory( char *path )