![[Contents]](../images/toc_d.gif) 
 ![[Index]](../images/index_d.gif) 
 ![[Help]](../images/help_d.gif) 
 ![[Retrace]](../images/retrace_d.gif) 
 ![[Browse <]](../images/prev.gif) 
 ![[Browse >]](../images/next.gif) 
    NAME
        ParentDir -- Obtain the parent of a directory or file
    SYNOPSIS
        newlock = ParentDir( lock )
        D0                   D1
        bptr parentdir(bptr)
    FUNCTION
        The argument 'lock' is associated with a given file or directory.
        ParentDir() returns 'newlock' which is associated the parent
        directory of 'lock'.
        Taking the ParentDir() of the root of the current filing system
        returns a NULL (0) lock.  Note this 0 lock represents the root of
        file system that you booted from (which is, in effect, the parent
        of all other file system roots.)
    INPUTS
        lock - BCPL pointer to a lock
    RESULTS
        newlock - BCPL pointer to a lock
    SEE ALSO
        lock(), duplock(), unlock(), parentoffh(), duplockfromfh()