Author Topic: Relative path problem - Save Project As  (Read 4071 times)

Balazs

  • Guest
Relative path problem - Save Project As
« on: December 08, 2006, 06:13:46 pm »
When I choose Save Project As, and I save my project to a different dir (one level deeper), my project files' paths are not updated, and when I open the saved as project, CB complains it can't find the source files (which is true, since it should have re-relativized the files: should have added a preceding "..\" to all files).

Is this going to be fixed?

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Relative path problem - Save Project As
« Reply #1 on: December 08, 2006, 09:38:03 pm »
If you will update your Operating System such that it automatically informs all applications where it is about to move/copy all its files, then I'd think CB could accommodate your request.

Will await your fixes.

Balazs

  • Guest
Re: Relative path problem - Save Project As
« Reply #2 on: December 08, 2006, 11:58:11 pm »
What's the OS got to do with this?

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Relative path problem - Save Project As
« Reply #3 on: December 09, 2006, 03:30:40 am »
What's the OS got to do with this?


When you use Save/SaveAs it invokes the OS native controls.
The native controls are completely independent of the data in files.

There is no way to know if you are saving the project file as a backup or template (in which the text should not be modified) or that you want the text to be treated as "meta data" to point to the project files.

You would have to implement some sort of meta data mechanism (ala OSX) to inform the app or os that files follow data or data follows files.

The data in the project file was built according to the location you specified when the project file was built(like a Make file). It has relative file paths in it just like a Make file.

When I move my Make files, I can't expect the file paths to be updated by the OS command that moved it.

CodeBlocks considers the source files to be relative to the location of the .cbp project file.

If you like, you could write a plugin that updates your project files when you move them.
« Last Edit: December 09, 2006, 03:52:27 am by Pecan »

Balazs

  • Guest
Re: Relative path problem - Save Project As
« Reply #4 on: December 09, 2006, 04:04:52 am »
I don't really seem to get this OS thing you're talking about, I just expect that when I choose Save Project As, the newly saved project will contain valid data. Currently, this is not the case, as it points to invalid locations of files. This makes Save Project As totally useless, as it is no more, than a simple file copy operation.
What makes it worse is the fact, that the newly saved (invalid) project is used from this point on.

Also, I DO NOT expect anything to happen to my project file's byte representation when I copy with Explorer for example.

If the Save Project As menu entry does nothing else, than a simple file copy operation, why is it even there?