Hi group, slowly, I am improving my project and I am testing it in Windows and Linux. On Windows I have no problem connecting to a libreoffice ods file. I have a .txt file with the path stored, I read it and open it from the program. Instead on Linux, the path is not opened. I would like to understand why. The .txt file is of the type: \PCUFFICIO\Desktop\H&FUTI~1\LISTIN~1\COSTOM~1.ODS/
the code is this:
Var f As new FolderItem (LeggiRigoFileDiTesto(4), FolderItem.PathModes.Native)
If f <> Nil Then
if f.Exists then
f.Open
else
messagebox " Attenzione, probabilmente il file " + LeggiRigoFileDiTesto(4) +" non esiste ..."
end if
Else // User Cancelled
messagebox "Attenzione ... il rigo n°4 del file di configurazione presenta un errore nella path '' " +LeggiRigoFileDiTesto(4) +" ''"
End If
LeggiRigoFileDiTesto() is a Methos that read my text file Impostazioni.txt
If FileDiTesto <> Nil Then ' Se il percorso del file non è vuoto
If FileDiTesto.Exists Then ' Se il file esiste
Dim strIN As TextInputStream
strIN = TextInputStream.Open(FileDiTesto)
strIN.Encoding = Encodings.UTF8
Dim esco as Boolean=False
Dim contatore as integer
contatore=0
Dim yourText as string
While Not strIN.EndOfFile and esco=False
' *** DA QUI Elimina tutti i commenti tra /* */
var rx as new RegEx
rx.SearchPattern = "(?U)/\*[\s\S]*\*/"
rx.ReplacementPattern = ""
rx.Options.ReplaceAllMatches = true
yourText = rx.Replace(strIN.ReadLine )
'*************************************************************
contatore=contatore+1
if contatore=indice then
esco=true
'messagebox "contatore="+ contatore.ToText + " indice= " + indice.ToText + " testo rigo=" + yourText + " Esco ="+ esco.ToString
end if
Wend
return yourText
strIN.Close
else
messagebox " Il file " + PathDelProgramma + " non esiste .."
CreaFileDiTesto("")
messagebox " E' stato creato un file temporaneo " + PathDelProgramma + ". Aprire il file, al suo interno c'è un'indicazione per ogni riga.."
End If
End If
I pass him the line to read and he reads the line to me.
The connection string for Linux requires the following path (obviously different from the Windows one): //media/noeli/Desktop PCUFFICIO/H&F UTILITA’/Listini-Elenchi/CostoMateriali.ods
The problem i think thas is : 1) On path 2) on command f.Open
But i not know because not work in Linux. In windows, no problem.
The path is a network location
.