Opening files from UNC Path in codelite

CodeLite installation/troubleshooting forum
User avatar
Rosch
CodeLite Enthusiast
Posts: 24
Joined: Fri Nov 02, 2012 4:28 pm
Genuine User: Yes
IDE Question: C++
Location: Germany
Contact:

Opening files from UNC Path in codelite

Post by Rosch »

Hi...

Just tried to open files from an UNC path on windows with the current version of codelite. This appears not to work. CodeLite says "Failed to open: \\<server>\<share>\<path_to_file>.c: No such file or directory" which is quite bad. The UNC pathes I try to open are perfectly valid and accessable. I can open the files in any other editor.

Is this a problem of CodeLite itself or wxWidgets?

Thanks for your help,

Roland
User avatar
Rosch
CodeLite Enthusiast
Posts: 24
Joined: Fri Nov 02, 2012 4:28 pm
Genuine User: Yes
IDE Question: C++
Location: Germany
Contact:

Re: Opening files from UNC Path in codelite

Post by Rosch »

Rosch wrote: Is this a problem of CodeLite itself or wxWidgets?
I believe I have found the problem. In codelite's mainbook.cpp
there is a static function IsFileExists(). On Windows it explicitely checks that a filename starts with a driveletter. If not it fails. When I remove this check (the whole function is only referenced once - so it can be removed at all) and replace it with a single

Code: Select all

fileName.FileExists() 
call my codelite can load files from UNC pathes just fine!

So why is this code present? A relict from older days or is there a concrete purpose behind it? I yet cannot find a problem after removing this line with codelite accessing files residing on UNC pathes.

Roland
User avatar
Jarod42
CodeLite Expert
Posts: 240
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: Opening files from UNC Path in codelite

Post by Jarod42 »

If I am correct,
all saved paths should be relative to project (or workspace).

So, you may have others problems with UNC path.
User avatar
Rosch
CodeLite Enthusiast
Posts: 24
Joined: Fri Nov 02, 2012 4:28 pm
Genuine User: Yes
IDE Question: C++
Location: Germany
Contact:

Re: Opening files from UNC Path in codelite

Post by Rosch »

Hi Jarod...

Well if a users chooses File->Open File and he chooses a file from an UNC path he should either get an error message saying UNC pathes are not working for some reason or see the file opened. Honestly I prefer the latter ...

I faced the problem in another situation:
I try to use CodeLite as front end for our very own buildsystem. We do have a somewhat larger codebase which is compiled cross on different servers and than combined together to bigger software distributions. Files/dlls I want to debug are often not compiled on my current machine (some assorted libraries I want to step into sometimes). I added some logic to gdb a long time ago to find the missing sourcecode on our network if it was not compiled locally, so my gdb version returns an UNC path to a sourcecode file which codelite should open when the user steps into such a library. After removing the aforementioned check for the driveletters it works the (for me) expected way.

IMHO any reasonable editor should nowadays be able to read files from UNC pathes and if there are no good reasons (I yet do not know) this check [c|s]hould IMHO be removed.

Roland
Post Reply