home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / NETWORK / GP25.ZIP / DOSTONET.PRG < prev    next >
Text File  |  1993-08-28  |  1KB  |  47 lines

  1. *    Function Name:    DosToNet()
  2. *    Parameters:        cFileSpec, file spec to convert to NetWare spec
  3. *
  4. *
  5. *    Description
  6. *
  7. *    The purpose of this function is to convert a DOS file spec to a NetWare file spec.
  8. *    if no drive or path is specified, the default drive/directory is used for the 
  9. *    conversion
  10. *
  11. Parameter cFileSpec
  12. Private cPath, cDrive, cName, cAnswer, c
  13.  
  14. cFileSpec=upper(alltrim(cFileSpec))
  15. cPath=path(cFileSpec)
  16. if empty(cPath)
  17.     cDrive=left(sys(5),1)
  18.     cPath=substr(sys(2003),2)+'\'  && Get default
  19. else
  20.     cDrive=left(cPath,1) && Get the drive letter
  21.     if len(cPath)>2
  22.         cPath=substr(cPath,3) && Trim the drive letter off cPath
  23.     else
  24.         cPath=''
  25.     endif
  26. endif
  27.  
  28. cName=Name(cFileSpec)
  29. cExt=ext(cFileSpec)
  30. cAnswer=cDrive+':\'+cPath+cName+'.'+cExt
  31. if !empty(n_ShellVer())
  32.     if empty(N_DrvPath(cDrive))
  33.         * Nothing
  34.     else
  35.         c=N_DrvPath(cDrive)
  36.         IF EMPTY(cPath)
  37.             cPath=substr(c,at(':',c)+1)+'\'
  38.         endif
  39.         if left(cPath,1)='\'
  40.             cPath=substr(cPath,2)
  41.         endif
  42.         cAnswer = left(c,at(':',c))+cPath+cName+'.'+cExt
  43.     endif
  44. endif
  45. return cAnswer
  46.  
  47.