FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour cFilePath issue.
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
cFilePath issue.
Posted: Tue Oct 31, 2023 06:31 PM
Hi,

This function is in filename.prg in \fwh\source\function directory.
Code (fw): Select all Collapse
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, "" ) )
I used this function in my application. file path I noticed it was in uppercase. This creates problems with the Turkish characters I use. Is there a purpose in using the upper function? (Note. When I remove the Upper function, the problem disappears)

How can I replace the cFilePath function with my own function? I don't want to change this function in the entire application.

Thanks.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: cFilePath issue.
Posted: Tue Oct 31, 2023 07:20 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: cFilePath issue.
Posted: Wed Nov 01, 2023 04:53 AM
I think there should be no problem in removing Upper.

Meanwhile just for discussion, other ways are
Code (fw): Select all Collapse
cPath := BeforAtNum( "\", TrueName( cFile ) ) + "\"
Regards



G. N. Rao.

Hyderabad, India
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: cFilePath issue.
Posted: Wed Nov 01, 2023 07:45 AM
nageswaragunupudi wrote:I think there should be no problem in removing Upper.

Meanwhile just for discussion, other ways are
Code (fw): Select all Collapse
cPath := BeforAtNum( "\", TrueName( cFile ) ) + "\"
Thank you Mr. Rao,

I understand that you recommend creating my own function and using it.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: cFilePath issue.
Posted: Wed Nov 01, 2023 08:37 AM
I understand that you recommend creating my own function and using it.
Not exactly.

We are going to remove Upper in the next version FWH2310 going to be released at any time.

I just availed the opportunity to discuss other options. Their functionality is not exactly like cFilePath
One more. Works only of if the file exists:
Code (fw): Select all Collapse
? FileSysObj():GetFile( cFile ):ParentFolder:Path
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion