Good morning group.
I managed to install XOjo on Linux, installed the scanner plugins … but now when I go to read the configuration file, it tells me it can’t find it. On Windows I have no problems, I give it the path to the file and inside it there are the various paths that I use in the program and it works, but in Linux it can’t find the configuration file. Are there any differences between Windows and Linux for searching/reading the .txt file?
Ok I’m studying the XOjo examples on Linux.
Most likely what worked on Windows, will not work on Linux (definitely my fault in design).
What path have you supplied in your app for Linux?
…in my mind, I wanted to read a .txt file inside the Database folder, with all the indications, but I think that by chance it worked in Windows, but now with Linux I have difficulty.
In the meantime I started to tell the program to identify which operating system is used, thanks to TargetWin32 and TargetLinux. Once the operating system has been identified, I will then have to correct the "/ or " if necessary…
At the moment in Windows the project file is located in: C:\Users\Federico\Desktop\TEST_XOJO\MioMagazzino where I have the Database, Images, etc. folders…
and in Linux: /home/noeli/Scrivania/TEST_XOJO/MioMagazzino
Now I wanted to read the path of the file in Windows, but I can’t, none of these give me the correct path:
Me.AddRow(“ApplicationData”, ShowValue(SpecialFolder.ApplicationData))
Me.AddRow(“Applications”, ShowValue(SpecialFolder.Applications))
Me.AddRow(“Bin”, ShowValue(SpecialFolder.Bin))
Me.AddRow(“Cookies”, ShowValue(SpecialFolder.Cookies))
Me.AddRow(“CurrentWorkingDirectory”, ShowValue(SpecialFolder.CurrentWorkingDirectory))
Me.AddRow(“Desktop”, ShowValue(SpecialFolder.Desktop))
Me.AddRow(“Documents”, ShowValue(SpecialFolder.Documents))
Me.AddRow(“Etc”, ShowValue(SpecialFolder.Etc))
Me.AddRow(“Extensions”, ShowValue(SpecialFolder.Extensions))
Me.AddRow(“Favorites”, ShowValue(SpecialFolder.Favorites))
Me.AddRow(“Fonts”, ShowValue(SpecialFolder.Fonts))
Me.AddRow(“History”, ShowValue(SpecialFolder.History))
Me.AddRow(“Home”, ShowValue(SpecialFolder.Home))
Me.AddRow(“InternetCache”, ShowValue(SpecialFolder.InternetCache))
Me.AddRow(“Library”, ShowValue(SpecialFolder.Library))
Me.AddRow(“Mount”, ShowValue(SpecialFolder.Mount))
Me.AddRow(“Movies”, ShowValue(SpecialFolder.Movies))
Me.AddRow(“Music”, ShowValue(SpecialFolder.Music))
Me.AddRow(“NetworkPlaces”, ShowValue(SpecialFolder.NetworkPlaces))
Me.AddRow(“Pictures”, ShowValue(SpecialFolder.Pictures))
Me.AddRow(“Preferences”, ShowValue(SpecialFolder.Preferences))
Me.AddRow(“Printers”, ShowValue(SpecialFolder.Printers))
Me.AddRow(“RecentItems”, ShowValue(SpecialFolder.RecentItems))
Me.AddRow(“Resources”, ShowValue(SpecialFolder.Resources))
Me.AddRow(“SBin”, ShowValue(SpecialFolder.SBin))
Me.AddRow(“SendTo”, ShowValue(SpecialFolder.SendTo))
Me.AddRow(“SharedApplicationData”, ShowValue(SpecialFolder.SharedApplicationData))
Me.AddRow(“SharedApplications”, ShowValue(SpecialFolder.SharedApplications))
Me.AddRow(“SharedDesktop”, ShowValue(SpecialFolder.SharedDesktop))
Me.AddRow(“SharedDocuments”, ShowValue(SpecialFolder.SharedDocuments))
Me.AddRow(“SharedFavorites”, ShowValue(SpecialFolder.SharedFavorites))
Me.AddRow(“SharedPreferences”, ShowValue(SpecialFolder.SharedPreferences))
Me.AddRow(“SharedStartupItems”, ShowValue(SpecialFolder.SharedStartupItems))
Me.AddRow(“SharedTemplates”, ShowValue(SpecialFolder.SharedTemplates))
Me.AddRow(“StartupItems”, ShowValue(SpecialFolder.StartupItems))
Me.AddRow(“System”, ShowValue(SpecialFolder.System))
Me.AddRow(“Templates”, ShowValue(SpecialFolder.Templates))
Me.AddRow(“Temporary”, ShowValue(SpecialFolder.Temporary))
Me.AddRow(“Trash”, ShowValue(SpecialFolder.Trash))
Me.AddRow(“UserBin”, ShowValue(SpecialFolder.UserBin))
Me.AddRow(“UserHome”, ShowValue(SpecialFolder.UserHome))
Me.AddRow(“UserLibrary”, ShowValue(SpecialFolder.UserLibrary))
Me.AddRow(“UserSBin”, ShowValue(SpecialFolder.UserSBin))
Me.AddRow(“Variable”, ShowValue(SpecialFolder.Variable))
Me.AddRow(“VariableLog”, ShowValue(SpecialFolder.VariableLog))
Me.AddRow(“Windows”, ShowValue(SpecialFolder.Windows))
Dim f As New FolderItem(“”)
f = f.Parent
Me.AddRow(“…Test current directory”, ShowValue(f))
(In Windows work … it’s correct for Linux ?)
I designed this, can it work?
FIleDiTesto is Folder item.
fileditesto = fileditesto.Parent
'Messagebox " Directory corrente: " + ShowValue(fileditesto)
#If DebugBuild Then
messagebox " Esecuzione in modalità DEBUG"
fileditesto = fileditesto.Parent
#else
messagebox "Esecuzione in modalità eseguibile"
fileditesto = fileditesto.Parent '"" AAA - ATTENZIONE - SETTARE !!!! Il Debug è diverso dall'eseguibile """"
#endif
PathDelProgramma=ShowValue(fileditesto)
if os="Windows" then
FileDiTesto = FileDiTesto.child("MioMagazzino\database\impostazioni.txt") 'anzichè Path+“database/impostazioni.txt”else
messagebox "Ubicazione file di progetto in Windows="+ PathDelProgramma
messagebox " Percorso file impostazioni.txt: " +ShowValue(FileDiTesto)
If Not (FileDiTesto is Nil) and FileDiTesto.Exists Then
messagebox "Cartella DATABASE e file impostazioni.txt esistono e sono nel posto giusto. Tutto OK"
else
Messagebox "Attenzione!!! Errore lettura cartella DATABASE o file IMPOSTAZIONI.TXT - Verificare nome cartella 'database' e che al suo interno sia presente il file impostazioni.txt"
exit
end if
else
if os="Linux" then
FileDiTesto = FileDiTesto.child("MioMagazzino/database/impostazioni.txt") 'anzichè Path+“database/impostazioni.txt”else
messagebox "Ubicazione file di progetto in Linux="+ PathDelProgramma
messagebox " Percorso file impostazioni.txt: " +ShowValue(FileDiTesto)
If Not (FileDiTesto is Nil) and FileDiTesto.Exists Then
messagebox "Cartella DATABASE e file impostazioni.txt esistono e sono nel posto giusto. Tutto OK"
else
Messagebox "Attenzione!!! Errore lettura cartella DATABASE o file IMPOSTAZIONI.TXT - Verificare nome cartella 'database' e che al suo interno sia presente il file impostazioni.txt"
exit
end if
else
messagebox "Sistema operativo non supportato"
exit
end if
end if