Move project to new pc
Posted
#1
(In Topic #863)
Trainee
I have a large project created on a pc running Linux Mint 20. Gambas 3.17 is running on that PC. I copied the whole project directory to a CD using Brassero. I copied this directory to a VirtualBox VM. I'm running Linux Mint 20.3 and Gambas 3.17.2 on the VM. When I check the copied directory there are over 400 files listed. When I open the directory only 3 are visible. When I try to load the project from the open project window; I click on the project. The project is not highlighted and will not load. Nothing is seen in the project files window. I know that Gambas works because I have made executables of other projects.
How can I transfer this project over to the VM. It should be possible. All answers are appreciated.
Thanks!
Marty
Posted
Guru

It sounds like you have not copied the 'hidden' files. I suggest you make a Source Archive:-
<IMG src="https://www.cogier.com/gambas/Copy1.png">
</IMG> Copy this file to your VM folder, then in Gambas File > Open project…
Right-click on the archive and select Uncompress file
Gambas will then jump straight to the new folder.
<IMG src="https://www.cogier.com/gambas/Copy2.png">
</IMG>
Posted
Trainee
Thank you for the response. Your suggestion appears to be correct. Made a source archive and loaded it. First I did not see any thing other then the Gambas background. Did a compile All and now I can see the files.
however I now see files named like this:
modMain.module(1)
modMain.Module(2)
ModMain.module(3)
modMain.module~(1)
modMain.Module~(2)
modMain.Module~(3)
modMain is a valid module name but, I think there was only one in the original project. What are they and should I do do anything with them?
Thanks,
Marty
Posted
Guru

modMain.module~(1)
modMain.Module~(2)
modMain.Module~(3)
The easy way is from Gambas use Project > Cleanup as I think these are just backup files, if they are this method will remove them.
Without seeing the whole program, I am unable to advise on the others.
Posted
Trainee
Tried to clean backup but the extra files were not removed. Each appears to be text file containing a class definition associated with a form. I added a short example below. For some reason I can not attach a text file so I had to cut and paste. This will give you an idea of what is contained in the files. All of the files under a form appear to be the same.
Gambas class file
Private Const Advanced_Height As Integer = 539
Private Const Basic_Height As Integer = 220
Private Const Form_Width As Integer = 651
Private Const Advanced_Cmd As String = "Add Director"
Private Const Basic_Cmd As String = "Current Directors"
Private flgAdvanced As Boolean = False
Public Sub Form_Open()
DataView1.View.Columns.Width = -1
Directors.Connection = modMain.$Con
Directors.Table = "tbldirectors"
Directors.Sort = "Director"
Directors.MoveFirst
Me.Caption = "Officers"
Me.Height = Basic_Height
Me.DataCombo1.Table = "tbllocation"
Me.DataCombo1.Display = "Location"
Me.DataCombo1.Field = "Locator"
Me.DataCombo2.Table = "tblofficers"
Me.DataCombo2.Display = "Position"
Me.DataCombo2.Field = "Office"
Me.Height = Basic_Height
lblAdvanced.Text = Advanced_Cmd
lblAdvanced.Foreground = modMain.Red
lblAdvanced.Visible = False
btnAdd.Visible = False
btnDelete.Visible = False
btnSave.Visible = False
btnCancel.Visible = False
modMain.Lock_Controls(frmDirectors)
End
Public Sub btnClose_Click()
Dim intResult As Integer
intResult = Message.Question("Closing", "OK", "Cancel")
If intResult = 1 Then
If modMain.flgAdd Or modMain.flgDirty Then
btnSave_Click()
Endif
Endif
Me.Close
End
Public Sub btnCancel_Click()
Dim intResult As Integer
intResult = Message.Question("Cancel", "OK", "No")
If intResult = 1 Then
If modMain.flgEdit Then
'modData.Read_Buffer(frmDirectors)
Directors.Cancel
Endif
modMain.flgEdit = False
modMain.flgAdd = False
modMain.flgDirty = False
btnAdd.Visible = False
btnDelete.Visible = False
btnSave.Visible = False
btnCancel.Visible = False
Hope this helps.
Marty
Posted
Guru

cd /project/folder
rm -f ".src/*~*"
rm -f ".src/*(*"
</HIGHLIGHT>
or press Ctrl-h to show all files in your file browser and find the files to delete
the files with ~ are backup files, just copies of the original ones.
the files with (1) etc are because you have repeatedly copied files when they already existed..
the above commands from the source dir should clear your backup/copies
Posted
Guru

By default when dragging files/folders most file managers like caja, dolphin, nautilus will not copy hidden or backup files unless you have selected to show the files first.
Any file/folder that begins with a dot like .src .gambas etc are "hidden"
Any file that ends with a tilde~ is a backup file.
Brassero may have a "Show hidden files" option or if you drag-dropped from desktop then show hidden files first (or make an archive).
Most file managers use Ctrl-h to show/hide hidden files.
Caja (MATE desktop file manager) uses Ctrl-h to show hidden files and Ctrl-k to show backup files but also those options are in the "View" menu.
PS.
If you right click a project folder and select "Compress" to make an archive most archivers WILL include hidden files regardless of the view.
THE most important files of your project are the .project file and the .src directory (both are hidden)
Posted
Trainee
Regards,
Marty
Posted
Guru

chmod -R +w /project/dir/*
Can't think of any other reason you can't remove a library?
Posted
Guru

Posted
Trainee
Changed permissions. No change. Still cannot get rid of the library. The warning is "Can not find library" and show the library directory. The directory shown does not exits. I was deleted log ago. Any other suggestions? I'll think about posting but, I'm reluctant to because of sensitive data concern.
Thanks,
Marty
Posted
Trainee
Any thoughts?
Regards,
Marty
Posted
Guru

Ham13 said
Of interest, the library I want to remove is not shown in /home/xxx/.local/share/gambas3/lib/unknown. The three legitimate libraries are listed. Maybe I can not delete the problem library is because its original directory was other than where it should have been and that directory does not exist.
Any thoughts?
Regards,
Marty
maybe see if it's listed in the projects .project file and remove the line declaring it?
I'ts a needle in a haystack without seeing your code.
can you remove any sensitive data then post it?
Posted
Trainee
I recreated the directory /home/marty/DBReport3 and added obfuscation to it. Now the project finds the library I want to delete but, I still can not delete it. Changed permissions on the directory to allow for deletions but, no change.However the project does not warn of a missing library anymore.
The libraries that I can add/remove are listed in /home/marty/.local/share/gambas3/lib/unknown. The problem child is in /home/marty/DBReport3/obfuscation.gambas.
Checked the .project file and found no libraries listed. There are also three copies of the files .project, .settings and .startup. Found the obfuscation.gambas library listed in the copies. I'll attach them so you can see them. Are there any other directories where Gambas stores libraries?
I tried runnig Gambas as Root but, found no projects. Maybe I should run it as Administrator if that is possible. For some reason I cannot attach files. It does not like something in the file name or that it is a hidden file.
Regards,
Marty
Posted
Trainee
Finally got the upload figured out. project.odt is the .project file. The others are also found in the project. They include 3 .project files, three .settings files and three .stratup files. Should these be deleted?
Hope this helps.
Regards,
Marty
.project File
Posted
Guru

Posted
Guru

Check out /install - Gambas Documentation and install the dependencies for your system.
I suggest copying your project and removing any sensitive data then make an archive and post it here.
We could clean it up and get to the heart of the problems.
Posted
Guru

Especially as you've not even mentioned the name of the offending library.
The more details we have the more we can help.
1 guest and 0 members have just viewed this.



