Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-03 Thread John Rose
Tobias, Thanks - that "--" method was new to me. Regards, John On 03/02/13 20:27, Tobias Boege wrote: > On Sun, 03 Feb 2013, John Rose wrote: >> Apologies, my mistake. Instead of saying that >> Exec ["gksudo", "desktop-file-install, sPath] >> or >> Exec ["gksudo", Shell$("desktop-file-install",

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-03 Thread Tobias Boege
On Sun, 03 Feb 2013, John Rose wrote: > Apologies, my mistake. Instead of saying that > Exec ["gksudo", "desktop-file-install, sPath] > or > Exec ["gksudo", Shell$("desktop-file-install", Shell$(sPath))] > did not work. > > I should have said that > Exec ["gksudo", "desktop-file-install", sPath] T

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-03 Thread John Rose
Apologies, my mistake. Instead of saying that Exec ["gksudo", "desktop-file-install, sPath] or Exec ["gksudo", Shell$("desktop-file-install", Shell$(sPath))] did not work. I should have said that Exec ["gksudo", "desktop-file-install", sPath] To sOutput did work: where, for example, sPath="/home/j

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-03 Thread Jussi Lahtinen
> OK. In order to put an end to this haunting I installed gksudo and the > following line is verified to work: > > ' This file exists and its path contains spaces, apparently > sPath = User.Home &/ "dir space" &/ "desktop space.desktop" > Exec ["gksudo", "desktop-file-install", sPath] > > The file

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-03 Thread Tobias Boege
On Sun, 03 Feb 2013, John Rose wrote: > Tobias, > > You were correct: > > Exec ["gksudo", Shell$("desktop-file-install " & Shell$(sPath))] > > did not work. > > I've posted this as issue #400 on > https://code.google.com/p/gambas/issues. It'll be interesting to see > Benoit's take on this. Un

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-03 Thread John Rose
Tobias, You were correct: Exec ["gksudo", Shell$("desktop-file-install " & Shell$(sPath))] did not work. I've posted this as issue #400 on https://code.google.com/p/gambas/issues. It'll be interesting to see Benoit's take on this. Unless there's a solution/workaround, it looks like it's best

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-03 Thread Tobias Boege
On Sun, 03 Feb 2013, John Rose wrote: > I've just tried using Exec with "gksudo" and having only one > concatenated parameter: > Exec ["gksudo", "desktop-file-install " & "--dir=" & sInstallDirectory & > " " & sPath] To sOutput > > It gave no errors but it didn't work. > > I was using Shell and

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-03 Thread John Rose
I've just tried using Exec with "gksudo" and having only one concatenated parameter: Exec ["gksudo", "desktop-file-install " & "--dir=" & sInstallDirectory & " " & sPath] To sOutput It gave no errors but it didn't work. I was using Shell and that worked with Shell$ applied to the directory and

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-03 Thread Jussi Lahtinen
Why you are not simply using Shell? Jussi On Sun, Feb 3, 2013 at 10:38 AM, John Rose wrote: > Apologies. I missed out the gksudo in my last message: > > The following works OK: > sPath = "/home/john/Temp orary/q w.desktop" > sLogPath = "/home/john/Temporary/Log.txt" > Wait 1 >

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-03 Thread Tobias Boege
On Sun, 03 Feb 2013, John Rose wrote: > Apologies. I missed out the gksudo in my last message: > > The following works OK: > sPath = "/home/john/Temp orary/q w.desktop" > sLogPath = "/home/john/Temporary/Log.txt" > Wait 1 > sCommand = "gksudo " & "desktop-file-install " & " " & >

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-03 Thread John Rose
Apologies. I missed out the gksudo in my last message: The following works OK: sPath = "/home/john/Temp orary/q w.desktop" sLogPath = "/home/john/Temporary/Log.txt" Wait 1 sCommand = "gksudo " & "desktop-file-install " & " " & Shell$(sPath) & " >/dev/n

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-02 Thread Tobias Boege
On Sat, 02 Feb 2013, John Rose wrote: > Tobias, > > OK that solves a simple example using Exec. Perhaps I should have given > a more complex example: one where the directory contains a space and/or > the filename contains a space: > It should work with as much spaces in the filenames as you wa

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-02 Thread John Rose
Tobias, OK that solves a simple example using Exec. Perhaps I should have given a more complex example: one where the directory contains a space and/or the filename contains a space: The following works OK: sPath = "/home/john/Temp orary/q w.desktop" sLogPath = "/home/john/Temporary/Log.t

Re: [Gambas-user] Delete a file requiring Admin privilege

2013-02-01 Thread Tobias Boege
On Fri, 01 Feb 2013, John Rose wrote: > I want (in Gambas3) to delete a file in e.g. /usr/share/applications. > sInstallPath may have spaces in its filename: that's why I used a single > quote round it. > > I've tried > Exec ["gksudo", "rm", "'" & sInstallPath & "'"] > which doesn't give an erro

[Gambas-user] Delete a file requiring Admin privilege

2013-02-01 Thread John Rose
I want (in Gambas3) to delete a file in e.g. /usr/share/applications. sInstallPath may have spaces in its filename: that's why I used a single quote round it. I've tried Exec ["gksudo", "rm", "'" & sInstallPath & "'"] which doesn't give an error but doesn't delete the file. I've tried Exec ["gk