# GetDirectory

Gets the item number and pathname for the current directory.

### Synopsis

`Item GetDirectory( char *pathBuf, int32 pathBufLen )`

### Description

This function returns the item number of the calling task's current directory. If pathBuf is non-NULL, it must point 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.

### Arguments

pathBuf
  A pointer to a buffer in which to receive the absolute pathname for the current directory. If you do not want to get the pathname string, use NULL as the value of this argument.

pathBufLen
  The size of the buffer pointed to by the pathBuf argument, in bytes, or zero if you don't provide a buffer.

### Return Value

The function returns the item number of the current directory.

### Implementation

SWI implemented in file folio V20.

### Associated Files

filefunctions.h

### See Also

`ChangeDirectory()`