Page 1 of 1
Opening files from UNC Path in codelite
Posted: Mon Nov 12, 2012 4:34 pm
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
Re: Opening files from UNC Path in codelite
Posted: Tue Nov 13, 2012 3:43 pm
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
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
Re: Opening files from UNC Path in codelite
Posted: Tue Nov 13, 2012 4:54 pm
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.
Re: Opening files from UNC Path in codelite
Posted: Wed Nov 14, 2012 1:44 pm
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