Günther,
Here you have it with UNC support. cFilePath() needs to be changed too:
function cFilePath( cPathMask ) // returns path of a filename
local lUNC := "/" $ cPathMask
local cSep := If( lUNC, "/", "\" )
local n := RAt( cSep, cPathMask ), cDisk
return If( n > 0, Upper( Left( cPathMask, n ) ),;
( cDisk := cFileDisc( cPathMask ) ) + If( ! Empty( cDisk ), cSep, "" ) )
function cFileSubDir( cPath ) // returns the subdir of a path & filename
local lUNC := "/" $ cPath
local cTemp := cFilePath( If( Right( cPath, 1 ) $ "\/" ,;
Left( cPath, Len( cPath ) - 1 ), cPath ) )
return If( ! lUNC, SubStr( cTemp, 4 ), cTemp )