Author Topic: Project file loses relative paths  (Read 2736 times)

Offline stewcam

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Project file loses relative paths
« on: March 06, 2011, 05:06:49 AM »
I have a project file which contains references to files on removable drive J. The files are in subfolders to the folder j:\ahk\scripts so the working directory path is set to this folder. This mostly works well. However from time to time HippoEdit rewrites the project file so that all the paths look like:

<File name="..\\..\\chgpt.ahk"/>

instead of the correct format, which is of type:

<File name="..\\..\\ahk\\scripts\\bp1misc\\chgpt.ahk"/>

I then have to edit the .heprj project file in another text editor, using search and replace to correct all the changed paths.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2224
  • Karma: +37/-3
    • HippoEDIT
Re: Project file loses relative paths
« Reply #1 on: March 07, 2011, 02:23:13 PM »
hi stew,

by design, file paths in project are stored relatively to project file path (not working directory; I can think about such extension also).  If item path is not relative to project path, it should be stored as absolute path.
If it is not a case, I need an example to reproduce the scenario. It is a bug. That "from time to time" does not help :)

Best regards,
Alex.

Offline stewcam

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: Project file loses relative paths
« Reply #2 on: March 09, 2011, 07:46:35 AM »
Thanks, Alex. I find it convenient to keep all project files in one directory. However, I prefer to store the actual files in each project in separate directories which are not subdirectories of the project file directory. As all files are on a USB stick I also prefer relative paths.

I will try to pinpoint what circumstances are provoking loss of the relative paths...

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2224
  • Karma: +37/-3
    • HippoEDIT
Re: Project file loses relative paths
« Reply #3 on: March 09, 2011, 02:44:21 PM »
Ok, thanks.
The reason for relative path was not only wish to keep project file smaller, but also support move scenarios, when project together with files moved to another location. I can also try to use Working Directory of project as root for relative paths, but this can broke old projects, which were saved relatively to project file location... So I need or a flag or a marker inside the project.
What do you think, is this option necessary (store relatively to Working Directory) or we can wait for next requests for this topic? ;)

Offline stewcam

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: Project file loses relative paths
« Reply #4 on: March 10, 2011, 10:58:36 AM »
I think having the working directory of the project as the root for relative paths makes a lot of sense. I find it very convenient to have all my project files in one directory, but would not like to have all the related files in subdirectories of that directory.