Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mapd2u(PCI) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

isvirtual(PCI)

mapu2d(PCI)


 mapd2u(PCI)                    6 January 1993                    mapd2u(PCI)


 Name

    mapd2u -  map a DOS path name to UNIX operating system path name

 Syntax


    #include <pcilib.h>


    #include <memmdl.h>

    int mapd2u( upath, dpath )
    char *upath, *dpath;


 Description

    mapd2u is a DOS function that returns, in UNIX operating system path name
    conventions, the fully qualified translation of a DOS path name.

    upath points to the UNIX operating system path name supplied by the func-
    tion.  It is a fully qualified, null-terminated string with a drive
    designation that exactly corresponds to the DOS path.

    dpath is the DOS path name.  It must be provided as a null-terminated
    string.

 Return value

    On successful completion, a value of 0 is returned.

    If the translation fails (the DOS file name does not exist), a value of
    -1 returns and the DOS error code is returned in errno.  The translation
    may fail if the DOS file name contains a single quote (').

 Example


               :
               :
       char uPath[128];
       char dPath[128] = "D:\\DOS\\PATHNAME";
       int  retVal;
               :
               :
       /* Find the UNIX name for the DOS path on virtual drive D:
       ** Note: If the DOS name has a drive designation, the returned UNIX
       ** path name will also have one.  (In this example it will be: D:)
       */
       if ( (retVal = mapd2u(uPath, dPath)) == -1 )
            errorHandler();
       else
            printf("Mapped UNIX name - including drive designation: %s",uPath);
               :
               :


 Bugs

    No error is returned if a path component does not exist. The nonexistent
    component and remainder of the path are simply forced to lowercase.  The
    calling program must ensure that the path exists before calling this
    function.

 See also

    isvirtual(PCI), mapu2d(PCI)


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026