Code
  1. Code
  2. CODE-64

PCG relative file path to companion

    Details

      Description

      SUBJECT: [pcgen] [pathfinder] PCG relative file path to companion
      DATE: 5/27/2010 3:35 PM (PDT)
      Submitter: saxum.caribetum@....

      I have hit a tiresome problem with the relative file-path handling:

      I have this Shadow Dancer that I've been blathering about. She and her
      mistress live in a Folder "Chars".
      Other characters, sent to me (as DM) by the head-of-family of the
      players, I place in a sub-folder, "Chars\HoF"

      So ... I had been working on more than one PC, in the sequence:

      Chars\Dancer.pcg
      Chars\Umbra.pcg
      Chars\HoF\Ranger.pcg

      having been out of PCGen and back in, I reloaded the Shadow Dancer for
      the Recent File List, and then tried to open the Shadow from her
      Inventory, Resources, Load button.

      I got an error claiming the file had moved - close inspection of the
      (rather long) absolute path, showed that PCGen had applied the last File
      Open path to the relative path, not the path to the (recent files
      opened) Dancer.... It was looking for

      Chars\HoF\Shadow.pcg
      not
      Chars\Shadow.pcg

      Actually it was worse than that... I'm not actually sure HOW it got so,
      but Dancer.pcg had been saved with the absolute path to the Shadow.pcg file:
      C:\Users\Neil\Documents\Games\Chars\umbra.pcg

      and the absolute path which was failing was:
      C:\Users\Neil\Documents\Games\Chars\C:\Users\Neil\Documents\Games\Chars\HoF\umbra.pcg

      so 2 bugs

      1. PCGen is mis-handling relative path filenames - which should be
      based on the path to the parent file, but are using the
      last-browsed File Open Dialog path
      2. PCGen is not recognising absolute pathnames and using the actual
      pathname as stored.

      I have a suspicion that PCGen writes an absolute path if the path is
      anything other than .\thing (which curiously PCGen writes as "\thing"
      not ".\thing"), and that PCGen does not handle eg "..\thing" or
      "..\images\picture.jpg".
      A small thing, perhaps, but not handling relative filenames well means
      it is hard to perform simple house-keeping like moving folders or
      renaming them.

      (At work we follow a simple rule:

      • use relative paths, including .. and sub-folders if the path to
        the linked file is on the same drive as the linking file
      • don't use more than 3 ..'s (..\..\..)
        (prevents sillies such as when everything is on C:, but one file
        is in Documents And Settings, and one is in a normal random
        folder, which you could reach as ..\..\..\..\..\Documents and
        Settings\neil\My Documents\thing)
      • otherwise write the absolute pathname
      • while in memory, all filenames are stored as absolute paths, and
        are relativised when a file containing a pathname is written to disk.
      • if you save a linked file to a new destination, change the
        absolute linked name to link to it, so saving the parent saves the
        right (freshly relativised) link, no matter where you then save
        the parent.

      )

        Activity

        Hide
        James Dempsey
        added a comment -

        There are two problems here:
        1. The character folder gets changed with each load and save. Thus relative folder references are frequently broken.
        2. The determination of a relative or absolute path is too simplistic and in conjunction with 1 can lead to incorrect paths being stored.

        Show
        James Dempsey
        added a comment - There are two problems here: 1. The character folder gets changed with each load and save. Thus relative folder references are frequently broken. 2. The determination of a relative or absolute path is too simplistic and in conjunction with 1 can lead to incorrect paths being stored.

          People

          • Assignee:
            James Dempsey
            Reporter:
            User Submissions
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: