Jump to content


Photo

Unable to use junction to keep files synchronized

dropboxjunctionssynchronize

Best Answer Iryoku , 14 February 2015 - 02:04 PM

I know he can't fix the function, but it's arguably working correctly (a junction doesn't mean anything exists at that location). I'm not really sure why GearSwap is even checking if the base directory exists. Instead of checking if the base directory exists, it makes more sense to check if the file it's looking for exists.
 
Edit:
@darsovit, I'm curious, does the same thing happen if you use a symbolic link instead of a junction/reparse point (yes they are different things)? Go to the full post


    9 replies to this topic

    #1 darsovit

    darsovit

      Newbie

    • Members
    • Pip
    • 6 posts

      Posted 12 February 2015 - 06:38 PM

      I'm trying to keep the gearswap files synchronized across multiple computers and multiple characters. I had done this in the past by using Dropbox and creating junctions from within the windower directory tree to my dropbox folders.

       

      C:\Program Files (x86)\Windower4\plugins\spellcast\Darsovit => C:\Users\username\Dropbox\Windower Stuff\Spellcast\Darsovit

       

      I could do this on any and all windows machines I used to play the game, but I cannot get the same to work with GearSwap files. I can create the junction ok:

       

      C:\Program Files (x86)\Windower4\addons\gearswap\data\Darsovit => C:\Users\username\Dropbox\Windower Stuff\Gearswap\Darsovit-gs

       

      But, gearswap won't load the lua files within the junction. My best guess is related to the fact that the gearswap lua files are considered executable pieces of code, and maybe there is a permissions related thing preventing gearswap from loading the files through a junction to the user-space (versus the xml files for spellcast were loading as data files).

       

      Does this sound like the most likely cause of my problem or is there some other fix I can use?

       

      Thanks, Darsovit



      #2 Iryoku

      Iryoku

        Advanced Member

      • Windower Staff
      • 488 posts

        Posted 12 February 2015 - 07:37 PM

        I suggest you just move your entire Windower install to dropbox and set dropbox not to sync the update or resources directories. That's what I do.



        #3 darsovit

        darsovit

          Newbie

        • Members
        • Pip
        • 6 posts

          Posted 12 February 2015 - 08:20 PM

          This doesn't really work well for me -- because the different computers I use have different capabilities graphics card wise.



          #4 Iryoku

          Iryoku

            Advanced Member

          • Windower Staff
          • 488 posts

            Posted 13 February 2015 - 01:06 PM

            In that case you have a few options, you can just set up different profiles for each PC and use the "Pin to Desktop" button in the launcher to create a shortcut for the correct profile. Alternatively, you can set your settings.xml file to not be synced by Dropbox as well and configure each PC separately.



            #5 darsovit

            darsovit

              Newbie

            • Members
            • Pip
            • 6 posts

              Posted 13 February 2015 - 01:43 PM

              Hello Iryoku,

               

              Thanks for the suggestions, but I don't really like the idea of having to keep track of all these folders turned off for sync within dropbox, or even running an executable stored within dropbox. I suppose what I'm requesting would open the door to loading my gearswap "executables" through there, but hopefully it is somewhat sandboxed within windower and are at least lua files, requiring dumping in some lua code to compromise my machine (versus a hacker somehow gaining access to the raw executables of any dropbox user through their servers).

               

              On another note, I've actually found what is causing it in the GearSwap code.

               

              In function pathsearch(files_list) in refresh.lua:

               

              line 632:   if windower.dir_exists(basepath) then ...

               

              When basepath is a junction instead of a real directory, this check is not passing. If I comment the line out (as well as its corresponding end), the junction to a dropbox folder works fine.

               

              I don't know if it would be difficult to add a check in the windower.dir_exists function to allow a junction to a directory to pass this check (i believe that one is private so I can't investigate), or if it might be better to just leave the line removed since I don't expect this function gets called frequently (I would expect just when a user changes jobs, etc)..

               

              Thanks,

              Darsovit



              #6 Iryoku

              Iryoku

                Advanced Member

              • Windower Staff
              • 488 posts

                Posted 13 February 2015 - 09:47 PM

                Submit a bug report to Byrth (you can find a link under GearSwap in the launcher).



                #7 Arcon

                Arcon

                  Advanced Member

                • Windower Staff
                • 1189 posts
                • LocationMunich, Germany

                Posted 13 February 2015 - 09:48 PM

                That's a LuaCore function, not much Byrth can do about it.



                #8 Iryoku

                Iryoku

                  Advanced Member

                • Windower Staff
                • 488 posts

                  Posted 14 February 2015 - 02:04 PM   Best Answer

                  I know he can't fix the function, but it's arguably working correctly (a junction doesn't mean anything exists at that location). I'm not really sure why GearSwap is even checking if the base directory exists. Instead of checking if the base directory exists, it makes more sense to check if the file it's looking for exists.
                   
                  Edit:
                  @darsovit, I'm curious, does the same thing happen if you use a symbolic link instead of a junction/reparse point (yes they are different things)?

                  #9 darsovit

                  darsovit

                    Newbie

                  • Members
                  • Pip
                  • 6 posts

                    Posted 14 February 2015 - 04:42 PM

                    Ah, yes changing it to a directory symbolic link instead did work. I'll close with that as solved solution.

                     

                    I can understand why he's checking for the directory existance since the code will send in a list of files to look for in that directory so for some savings he can just check if the directory existed.

                     

                    Right now I only have access to my win 8.1 laptop (will also verify it works on windows 7 desktop when I'm able).

                     

                    Thanks,

                    Darsovit



                    #10 darsovit

                    darsovit

                      Newbie

                    • Members
                    • Pip
                    • 6 posts

                      Posted 22 February 2015 - 02:23 PM

                      This also worked on Windows 7 desktop machine. Thanks!






                      1 user(s) are reading this topic

                      0 members, 1 guests, 0 anonymous users