xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

CurDirX()

Returns the current directory of a drive including directory separators.

Syntax

CurDir( [<cDrive>] ) --> cDirPath

Arguments

<cDrive>
A single character, optionally followed by a colon, specifies the disk drive to query. If omitted, the current drive is queried.

Return

The function returns the current directory of the specified disk drive as a character string including leading and trailing directory separator.

Description

CurDirX() works exacly like CurDir() but adds a leading and trailing directory separator to the returned directory string

Info

See also:CurDir(), CurDrive(), DirChange(), Directory(), DirRemove(), File(), Getenv(), MakeDir()
Category: Directory functions , File functions , xHarbour extensions
Source:rtl\philes.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example compares CurDir() and CurDirX()

   PROCEDURE Main
      LOCAL nDrive := Asc( "C" )
      LOCAL i

      // directory with CurDir()
      FOR i:=1 TO 7
         ? Chr( nDrive ) + ":\"+ CurDir( Chr(nDrive) ) + "\"
         nDrive ++
      NEXT

      nDrive := Asc( "C" )
      // directory with CurDirX()
      FOR i:=1 TO 7
         ? Chr( nDrive ) + ":"+ CurDirX( Chr(nDrive) )
         nDrive ++
      NEXT

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe