Problem with the path to the Library folder

Discuss the Integrated Development Environment (IDE)

Moderators: David Barker, Jerry Messina

garryp4
Posts: 125
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Problem with the path to the Library folder

Post by garryp4 » Thu Aug 27, 2020 3:13 pm

I'm having a problem with Swordfish creating a library directory in the wrong place. The correct path to the library is c:\ProgramData\Mecanique|Swordfish\Library. However, when I select some modules from the Code Explorer list, and if that module is in c:\users\g\documents\swordfish\userlibrary, that module opens up. I have completely deleted the library under c:\users and Swordfish will the open the correct library. But the next time I launch Swordfish the c:\users\g\documents\swordfish\userlibrary directory is recreated again. I have completely uninstalled Swordfish, ren CCCleaner registry clean, Deleted every Swordfish directory, then searched the registry with RegEdit and looked for any reference to Swordfish. It appeared to be completely wipped from my laptop. Then I re-loaded the newest rev of Swordfish and get the exact same issue. I can duplicate this every time. Anyone have any ideas?

Thanks,
Garry

garryp4
Posts: 125
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Re: Problem with the path to the Library folder

Post by garryp4 » Thu Aug 27, 2020 3:17 pm

Also, I have just set up a fresh tower PC and loaded Swordfish and do not get this problem. Both are running Windows 10.

bitfogav
Registered User
Registered User
Posts: 169
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: Problem with the path to the Library folder

Post by bitfogav » Sat Aug 29, 2020 8:53 am

I'm not sure that what you are seeing is incorrect..
Swordfish will always look in the C:\User\Documents library before looking in the C:\ProgramData library.
A Swordfish library on my windows 10 Installs in C:\ProgrammeData and it will always recreate a user library in C:\User\Documents..

garryp4
Posts: 125
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Re: Problem with the path to the Library folder

Post by garryp4 » Sat Aug 29, 2020 2:16 pm

Any updates go to the c:\ProgramData\Mecanique|Swordfish\Library so it seems Swordfish should look there first, then the working directory. Otherwise the libraries will not be current.

bitfogav
Registered User
Registered User
Posts: 169
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: Problem with the path to the Library folder

Post by bitfogav » Sat Aug 29, 2020 3:18 pm

garryp4 wrote:
Sat Aug 29, 2020 2:16 pm
Any updates go to the c:\ProgramData\Mecanique|Swordfish\Library so it seems Swordfish should look there first, then the working directory. Otherwise the libraries will not be current.
Any Compiler update will update the default libraries in C:\ProgramData\Mecanique|Swordfish\Library, but if you have a copy of any of the
default libraries in the location of C:\Users\<Name>\Documents\Swordfish\UserLibrary then these will over ride the compiler default libraries..
Compiler will search for modules in the following order..

(a) in the folder that contains the main program
(b) the user library folder
(c) the system library folder


https://www.sfcompiler.co.uk/phpBB3/vie ... arch#p9070

garryp4
Posts: 125
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Re: Problem with the path to the Library folder

Post by garryp4 » Tue Sep 01, 2020 4:14 pm

There in lies a problem. The updates go tot the c:\ProgramData\Mecanique|Swordfish\Library directory and Swordfish looks first in c:\users\g\documents\swordfish\userlibrary, missing the updated modules.

And why does Swordfish keep creating the c:\users\g\documents\swordfish\userlibrary directory after I delete it? I also set up Swordfish on a completely wiped desktop and the c:\users\g\documents\swordfish\userlibrary directory does not exist, so it apparently is not needed. However I can not keep it off my laptop as it is recreated every time Swordfish starts.

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Problem with the path to the Library folder

Post by Jerry Messina » Tue Sep 01, 2020 4:27 pm

Putting files into the userlibrary allows you to override what's in the standard library folder.
If you want to use the standard copy, get rid of the one in userlibrary.

The installer doesn't touch what's in the userlibrary... you wouldn't want it to delete modules you may have changed.
That does mean that your userlibary copy won't get any updates applied to it, but that's something you'd have to manage yourself.

garryp4
Posts: 125
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Re: Problem with the path to the Library folder

Post by garryp4 » Tue Sep 01, 2020 4:42 pm

I delete the complete user Swordfish directory, close explorer then reopen to verify the directory is still gone. Then I launch Swordfish and the user directory is re-created. I can duplicate this every time. I went so far as wiping Swordfish and the user directory off the system. I even did a search of the registry for any mention of 'swordfish'. Then re-installed swordfish, and get the same thing. Every time. However it does not happen on the new system. a bit perplexing.

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Problem with the path to the Library folder

Post by Jerry Messina » Tue Sep 01, 2020 5:05 pm

If you were to delete the two folders:
c:\users\g\documents\swordfish\userlibrary
C:\ProgramData\Mecanique\Swordfish\userlibrary

then I don't know where in the world it could pull a copy from!

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: Problem with the path to the Library folder

Post by David Barker » Wed Sep 02, 2020 7:16 am

You could try enabling "VIEW...EDITOR OPTIONS" -> "Display Full Filename in Application Title Bar" to see where any file is located.

garryp4
Posts: 125
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Re: Problem with the path to the Library folder

Post by garryp4 » Fri Sep 04, 2020 4:49 pm

I uninstalled both Swordfish and Firewing from the laptop system. Then I deleted C:\ProgramData\Mecanique. Then I deleted c:\users\g\documents\swordfish. Then I deleted c:\ProgramFiles\mecanique. There should have been no reference to Swordfish or Firewing left on the system. The I installed the current rev of Swordfish. The C:\ProgramData\Mecanique\Swordfish\userlibrary was created during the install but the c:\users\g\documents\swordfish\userlibrary still did not exist. As soon as I launched Swordfish, c:\users\g\documents\swordfish\userlibrary was recreated.

David: I do keep the file path visible in the Title Bar. It is what led me to finding why I was having problems with using old module versions. Now that I understand what is happening, I can work around it. I'm trying to figure out why one system work different than another with the same Swordfish rev and both running Windows 10.

Thanks,
Garry

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: Problem with the path to the Library folder

Post by David Barker » Sat Sep 05, 2020 8:30 am

You have described the correct behaviour for an install

> c:\users\g\documents\swordfish\userlibrary still did not exist

An operating system may have multiple accounts. So when the application is first run it creates a unique copy of certain directories to ensure that if any changes are made by an individual user, it does not impact other accounts. The private "documents" area is created at runtime from the contents of the public "all users" folder created at install time.

garryp4
Posts: 125
Joined: Mon May 21, 2007 7:18 am
Location: Loveland, CO USA

Re: Problem with the path to the Library folder

Post by garryp4 » Wed Dec 16, 2020 11:20 pm

David:
I think there is still an issue with the hierarchy of the selected folder. First should be the root folder the current working .bas file is in. Second should be the c:\ProgramData\Mecanique\Swordfish\Library so as those files get updated, the newest one is used.

I am currently writing a new program and did an include to strings.bas. The IDE somehow found a copy dated 2006 from a directory I was using back then. I tried coping the current version from 2019 into my working directory and it still links to the 2006 version.

Other than coping the 2019 version into the old 2006 directory, how can I use it?

Thanks,
Garry

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: Problem with the path to the Library folder

Post by David Barker » Thu Dec 17, 2020 7:43 am

The priority is:

(1) folder that contains the main program you are compiling

then

(2) swordfish user library

then

(3) swordfish standard library

it has always been like that - no changes have been made to include lookup priorities

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Problem with the path to the Library folder

Post by Jerry Messina » Thu Dec 17, 2020 6:47 pm

The IDE somehow found a copy dated 2006 from a directory I was using back then. I tried coping the current version from 2019 into my working directory and it still links to the 2006 version.
If you look in the project .idf file, the second section (.file) includes a list of all the included files along with their path.

On thing that's maybe not obvious in the priority list is that when a folder is searched, any sub-folders under that path are also searched.
So, if you have sub-folders under your project directory (1), they'll get searched too before moving on to (2) and its subfloders and then to (3) and its subfolders.

Post Reply