Re: Error by creating a file in a folder
Jon Ogden <[email protected]> Mon, 30 Oct 2017 14:29:55 -0500
| Newsgroups | gmane.comp.lang.realbasic.user |
|---|---|
| Message-ID | <[email protected]> |
First of all, you should never create a file in the folder where the application resides. That is asking for trouble as you may not have write permissions there and he likely doesn’t. It’s possible he updated his OS recently. Files for the app should be created in ~/Library/Application Support if it is user specific or /Library/Application Support for global settings. Why it works with an older version of your app and not with the newer, version, I am not sure. Getting debugging data from your customer would be helpful. But the first step I would do is not create the Xml file in the same directory as the app. Regards, Jon > On Oct 30, 2017, at 1:43 PM, Claudius Sailer <[email protected]> wrote: > > Hello, > > a customer of my application (MacOS X) has the following problem with a new version. The older application works fine and I doesn’t change anything of this part of the application. > > When he starts my application the application try to create a file „Voreinstellungen.xml“ in the same directory where the application is. but he gets an error message that the application can’t create the file or can’t open the file. > > this is my code > > Dim g as FolderItem > > if NOT PrefsWerdenGeladen then > PrefsWerdenGeladen=true > > g=GetFolderItem(PrefsDatei) > MsgBox g.AbsolutePath + " " + g.Name + " " + g.Permissions.ToText > if g<> nil and g.iswriteable and NOT g.locked then > If PrefDic.SaveXML(g, False) Then > // Saved > Else > MsgBox "Error saving XML" > End If > elseif g=nil then > //allgemeines Problem > Fehlermeldung(TextFehler003a + PrefsDatei + TextFehler003c) > elseif NOT g.iswriteable then > //Datei ist schreibgeschuetzt oder schon in Benutzung > Fehlermeldung(TextFehler003a + PrefsDatei + TextFehler003b + " (is not writable)") > elseif g.Locked then > //Datei ist schreibgeschuetzt oder schon in Benutzung > Fehlermeldung(TextFehler003a + PrefsDatei + TextFehler003b + " (locked)") > end if > > PrefsWerdenGeladen=false > end if > > the MsgBox is new testing Code. At the moment I have no screenshot of this. I am waiting for response from my customer. > PrefsDatei is only a string „Voreinstellungen.xml" > > do you have any idea where this is coming from and how I can fix this. I have on all of my Computers nowhere this problem and the user sends me screenshots where I can see that permissions are read and write for his user to the folder and the files in this folder. When he copies the Voreinstellungen.xml file in the folder to the Application he catches the same error message but the file has also the permissions read and write for him. > > thanks for ideas and help. It would be great also when you have some ideas what code I could add to make testing and finding the problem easier. > > It is so difficult to find a solution, when the problem is not reproducible ob my computer. > When I get more informations/feedback I will add it to this post. > > > Claudius > > > To unsubscribe, email [email protected] > To unsubscribe, email [email protected]