Author Topic: absolute path in workspace file while using linux  (Read 12549 times)

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
absolute path in workspace file while using linux
« on: May 26, 2009, 03:03:36 pm »
CB 5535, Vista
CB 5607, Debian Lenny

I'm using CB to write applications which are portable between Windows and Linux. So I've got one workspace file gathering all my projects. Every project has Build Targets for Windows and Linux. The projects are hosted on Windows below a directory named "C:\_workspaces".

Linux is running as Colinux on the same computer. The C:\_workspaces directory is mounted via cofs in /mnt/_workspaces. To simplify the path, I've created a symbolic link named /_workspaces. (Yes, I'm working as root - no security hints please...  :D )

Short form: C:\_workspaces in Windows == /_workspaces in Linux.

My problem is, that the workspace file contains relative paths for my projects while using Windows, but unfortunately absolute paths while using Linux. That means I've to write a separate workspace file for every OS  :cry:

To make the item more clear, here are the workspace files:

Windows workspace file
Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="Default workspace">
<Project filename="_prj\libsmtp-0.8.5\libsmtp-0.8.5.cbp" active="1" />
<Project filename="_prj\ctools\ctools.cbp" />
<Project filename="_prj\htm_work\htm_work.cbp" />
<Project filename="_prj\htm_term\htm_term.cbp" />
<Project filename="_prj\smsrecvd\smsrecvd.cbp" />
<Project filename="_prj\zdbserv\zdbserv.cbp" />
</Workspace>
</CodeBlocks_workspace_file>

Linux workspace file
Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="Default workspace">
<Project filename="../../../../mnt/_workspaces/_ver3-n_3_5_03_001/_ver3/_32cnvt/_prj/libsmtp-0.8.5/libsmtp-0.8.5.cbp" active="1" />
<Project filename="../../../../mnt/_workspaces/_ver3-n_3_5_03_001/_ver3/_32cnvt/_prj/ctools/ctools.cbp" />
<Project filename="../../../../mnt/_workspaces/_ver3-n_3_5_03_001/_ver3/_32cnvt/_prj/zdbserv/zdbserv.cbp" />
<Project filename="../../../../mnt/_workspaces/_ver3-n_3_5_03_001/_ver3/_32cnvt/_prj/htm_work/htm_work.cbp" />
<Project filename="../../../../mnt/_workspaces/_ver3-n_3_5_03_001/_ver3/_32cnvt/_prj/htm_term/htm_term.cbp" />
<Project filename="../../../../mnt/_workspaces/_ver3-n_3_5_03_001/_ver3/_32cnvt/_prj/smsrecvd/smsrecvd.cbp" />
</Workspace>
</CodeBlocks_workspace_file>

Could it be possible to change this behavior so that CB under Linux is writing relative paths too?
« Last Edit: May 26, 2009, 05:11:10 pm by jomeggs »

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Re: absolute path in workspace file while using linux
« Reply #1 on: June 02, 2009, 02:41:32 pm »
Nobody who could help me with this item?


Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Re: absolute path in workspace file while using linux
« Reply #2 on: June 13, 2009, 11:33:03 pm »
Bump  :lol:

Nobody? Really? Oh please, could sombody help me here?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: absolute path in workspace file while using linux
« Reply #3 on: June 13, 2009, 11:38:35 pm »
also on linux you have relative paths, look at your workspace : ../../.. and so on.

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Re: absolute path in workspace file while using linux
« Reply #4 on: June 13, 2009, 11:42:41 pm »
Ahh! Thanks for your reply!

Yes, they ARE relative, you're right. But start of the path is ../../../../mnt/_workspaces/_ver3-n_3_5_03_001/_ver3/_32cnvt/_prj instead of _prj.

That is my problem, I can't use the same workspace file in WINDOWS and LINUX this way.
« Last Edit: June 13, 2009, 11:50:24 pm by jomeggs »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: absolute path in workspace file while using linux
« Reply #5 on: June 14, 2009, 01:58:44 am »
Ijust give it a short try, for a project residing on a vfat-partition, that I have mounted in a directory in winxp and mounted "normally" in linux.

I have got the exactly same workspaces for windows and linux, except for the filepath-seperators (slash on linux and backslash on windows).

The difference is, that my linux is a "real" (standalone) linux and not colinux.
I don't know if that can cause the problems.

Offline glorinand

  • Single posting newcomer
  • *
  • Posts: 3
Re: absolute path in workspace file while using linux
« Reply #6 on: August 19, 2009, 11:15:51 am »
Hi there! I experience this problem as well.

It happens when I create my workspace in, say, /home/username/workspace_dir/. Let's say that my workspace contains the following projects:
/home/username/workspace_dir/proj1.cbp,
/home/username/workspace_dir/proj2.cbp.

Then however I decide that I use this workspace rather often and I make a symbolic link like so: ln -s /home/username/workspace_dir/ home/username/Desktop/workspace_dir, so that I don't have to go running through my all directories every time I want to access it.

However, Code::Blocks does not seem to get this and instead of simple entries like proj1.cbp and proj2.cbp, the workspace will now contain ../workspace_dir/proj1.cbp and ../workspace_dir/proj2.cbp.

Offline glorinand

  • Single posting newcomer
  • *
  • Posts: 3
Re: absolute path in workspace file while using linux
« Reply #7 on: August 19, 2009, 11:26:46 am »
Btw. – jomeggs, if this applies to you as well, you may work around this by creating a launcher (e.g. nautilus /home/username/workspace_dir/) instead of a symlink; that should help – at least until this behaviour gets fixed.  :)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: absolute path in workspace file while using linux
« Reply #8 on: August 19, 2009, 11:36:27 am »
With symlinks you will run into trouble in debug mode.
See here and the following posts, I posted a possible solution in the same thread.

Offline glorinand

  • Single posting newcomer
  • *
  • Posts: 3
Re: absolute path in workspace file while using linux
« Reply #9 on: August 19, 2009, 11:52:43 am »
Ah, you are right, that did happen from time to time as well... I never figured it was related. XD