xHarbour Reference Documentation > Function Reference |
Returns the operating specific separator character for a path.
HB_OsPathSeparator() --> cDelimiter
The function returns a character used as separator between subdirectories in a full qualified file name.
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 |
// 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
http://www.xHarbour.com