xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_OsPathSeparator()

Returns the operating specific separator character for a path.

Syntax

HB_OsPathSeparator() --> cDelimiter

Return

The function returns a character used as separator between subdirectories in a full qualified file name.

Info

See also:HB_OsNewLine(), HB_OsDriveSeparator(), HB_OsPathDelimiters(), HB_OsPathListSeparator()
Category: Environment functions , xHarbour extensions
Source:rtl\philes.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example implements a function filling an array with the
// information of a full qualified file name. The first element holds
// the drive and root directory while the last element contains the file
// name. All elements in between hold names of subdirectories

   PROCEDURE Main
      LOCAL cFile := "c:\xhb\source\rtl\philes.c"
      LOCAL aFile := AGetFile( cFile )

      AEval( aFile, {|c| QOut(c) } )
      ** output
      // c:
      // xhb
      // source
      // rtl
      // philes.c
   RETURN

   FUNCTION AGetFile( cFileName )
      LOCAL cDelim := HB_OsPathSeparator()
      LOCAL aFile  := {}
      LOCAL nStart := 1
      LOCAL nEnd

      DO WHILE ( nEnd := At( cDelim, cFileName, nStart ) ) > 0
         AAdd( aFile, SubStr( cFileName, nStart, nEnd - nStart ) )
         nStart := nEnd + 1
      ENDDO
   RETURN aFile

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