[Gambas-user] Delete a file requiring Admin privilege

John Rose john.aaron.rose at ...626...
Sun Feb 3 21:09:57 CET 2013


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/john/Temp orary/q w.desktop".
and
Exec ["gksudo", "desktop-file-install", "--dir=" & sInstallDirectory, 
sPath] To sOutput
did not work (i.e. sOutput gives 'help for gksudo'): where, for example, 
sInstallDirectory= "/usr/share/applications" and 
sPath="/home/john/Temporary/q.desktop".
and
Exec ["gksudo", "desktop-file-install", Shell$("--dir=" & 
sInstallDirectory), Shell$(sPath)] To sOutput
did not work (i.e. sOutput gives 'help for gksudo'): where, for example, 
sInstallDirectory= "/usr/share/applications" and 
sPath="/home/john/Temporary/q.desktop".

In other words, the "--dir" option causes the problem not the space in 
the directory or filename.

Could someone check this to confirm or not that I am correct?

Regards,
John

On 03/02/13 18:15, Tobias Boege wrote:
> 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. Unless there's a solution/workaround, it looks
>> like it's best to use Shell when using gksudo.
>>
>> Regards,
>> John
> 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 _is_ copied into /usr/share/applications/.
>
> It _must_ consequently be some issue with your system. I've tested this
> under Arch Linux: gksudo is symlinked to gksu, version 2.0.2.
>
> Regards,
> Tobi
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list