Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdlib.h>
    char *_fullpath( char *buffer,
                     const char *path,
                     size_t size );
    wchar_t *_wfullpath( wchar_t *buffer ,
                         const wchar_t *path,
                         size_t size );

Description:
    The _fullpath function returns the full pathname of the file
    specification in path in the specified buffer buffer of length size.

    The maximum size that might be required for buffer is  _MAX_PATH.  If
    the buffer provided is too small, NULL is returned and  errno is set.

    If buffer is NULL then a buffer of size  _MAX_PATH is allocated using
     malloc.  This buffer may be freed using the  free function.

    If path is NULL or points to a null string ("") then the current working
    directory is returned in buffer.

    The _wfullpath function is a wide-character version of _fullpath that
    operates with wide-character strings.

Returns:
    The _fullpath function returns a pointer to the full path specification
    if no error occurred.  Otherwise, NULL is returned.

Errors:
    When an error has occurred,  errno contains a value indicating the type
    of error that has been detected.

    Constant     Meaning

ENOENT
    The current working directory could not be obtained.

ENOMEM
    The buffer could not be allocated.

ERANGE
    The buffer passed was too small.


Example:
    #include <stdio.h>
    #include <stdlib.h>

    void main( int argc, char *argv[] )
      {
        int i;
        char buff[ PATH_MAX ];

        for( i = 1; i < argc; ++i ) {
          puts( argv[i] );
          if( _fullpath( buff, argv[i], PATH_MAX ) ) {
            puts( buff );
          } else {
            puts( "FAIL!" );
          }
        }
      }

Classification:
    WATCOM

Systems:
     _fullpath - All, Netware

    _wfullpath - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

See Also:
    _makepath, _splitpath

See Also:

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson