Quantcast

how-to execute file or bash script packaged inside gambas

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how-to execute file or bash script packaged inside gambas

Nicolas Koch
Ok so I have created a gambas application and everything works except
for exec or shell a bash script that is packaged in the data folder
update.sh

How do I get Gambas to run scripts packaged in project.gambas?

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside gambas

Stefano Palmeri
Il sabato 22 novembre 2008 15:23:09 Nicolas Koch ha scritto:

> Ok so I have created a gambas application and everything works except
> for exec or shell a bash script that is packaged in the data folder
> update.sh
>
> How do I get Gambas to run scripts packaged in project.gambas?
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge Build the coolest Linux based applications with Moblin SDK & win
> great prizes Grand prize is a trip for two to an Open Source event anywhere
> in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
---------------------------------------------
DIM sTempScript as String

sTempScript = Temp$

COPY "update.sh" TO sTempscript

SHELL sTempScript WAIT
--------------------------------------------

This works if update.sh is in the project folder. If you create
a sub-folder to store your data the code is:

COPY "your_sub-folder/update.sh" TO sTempscript


Bye,

Stefano



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside gambas

Nicolas Koch
Stefano,

Thank you so much.

> ---------------------------------------------
> DIM sTempScript as String
>
> sTempScript = Temp$
>
> COPY "update.sh" TO sTempscript
>
> SHELL sTempScript WAIT
> --------------------------------------------

Regards,

Nick

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside gambas

Marty
In reply to this post by Nicolas Koch
Want to run a script file packaged within the Gambas project. Tried the method below.

DIM sTempScript as String

sTempScript = Temp$

COPY "update.sh" TO sTempscript

SHELL sTempScript WAIT

Does not work for me. All of the python files are in the gambas project directory and have execute permissions.

The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission denied

What do I change to allow the python programs to run? Is it the project directory?

Thanks,
Marty
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside gambas

Benoît Minisini
Le 28/01/2017 à 18:07, Marty a écrit :

> Want to run a script file packaged within the Gambas project. Tried the
> method below.
>
> DIM sTempScript as String
>
> sTempScript = Temp$
>
> COPY "update.sh" TO sTempscript
>
> SHELL sTempScript WAIT
>
> Does not work for me. All of the python files are in the gambas project
> directory and have execute permissions.
>
> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission denied
>
> What do I change to allow the python programs to run? Is it the project
> directory?
>
> Thanks,
> Marty
>

Did you set execution rights on the shell file?

--
Benoît Minisini

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside gambas

Benoît Minisini
Le 28/01/2017 à 20:03, Benoît Minisini a écrit :

> Le 28/01/2017 à 18:07, Marty a écrit :
>> Want to run a script file packaged within the Gambas project. Tried the
>> method below.
>>
>> DIM sTempScript as String
>>
>> sTempScript = Temp$
>>
>> COPY "update.sh" TO sTempscript
>>
>> SHELL sTempScript WAIT
>>
>> Does not work for me. All of the python files are in the gambas project
>> directory and have execute permissions.
>>
>> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission denied
>>
>> What do I change to allow the python programs to run? Is it the project
>> directory?
>>
>> Thanks,
>> Marty
>>
>
> Did you set execution rights on the shell file?
>

I mean on the copy. The permissions on the original file are ignored
once you make an executable (they are all read-only and not executable).

--
Benoît Minisini

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside gambas

Jussi Lahtinen
Also does the tmp partition have noexec set (check /etc/fstab)? It's common
way to harden Linux installation, but people kind of abuses /tmp... it's
not for executions.


Jussi

On Sat, Jan 28, 2017 at 9:09 PM, Benoît Minisini <
[hidden email]> wrote:

> Le 28/01/2017 à 20:03, Benoît Minisini a écrit :
> > Le 28/01/2017 à 18:07, Marty a écrit :
> >> Want to run a script file packaged within the Gambas project. Tried the
> >> method below.
> >>
> >> DIM sTempScript as String
> >>
> >> sTempScript = Temp$
> >>
> >> COPY "update.sh" TO sTempscript
> >>
> >> SHELL sTempScript WAIT
> >>
> >> Does not work for me. All of the python files are in the gambas project
> >> directory and have execute permissions.
> >>
> >> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission denied
> >>
> >> What do I change to allow the python programs to run? Is it the project
> >> directory?
> >>
> >> Thanks,
> >> Marty
> >>
> >
> > Did you set execution rights on the shell file?
> >
>
> I mean on the copy. The permissions on the original file are ignored
> once you make an executable (they are all read-only and not executable).
>
> --
> Benoît Minisini
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: how-to execute file or bash script packaged inside Gambas

Marty

Jussi,

 

Thanks for your response. I’ve checked /etc/fstab and There are only two partitions the main and swap. I do not see any entry for a tmp partition. I’m running Gambas 3.91 under Mint17.1.

Did a routine install when I installed it right from the CD.

 

Bennoit,

 

Thanks for your suggestion also. All of the files in the project directory have execute permissions set. Where is /tmp/Gambas located? I look at its permissions.

 

Marty

 

From: Jussi Lahtinen [via Gambas] [mailto:[hidden email]]
Sent: Saturday, January 28, 2017 12:38 PM
To: Marty <[hidden email]>
Subject: Re: how-to execute file or bash script packaged inside gambas

 

Also does the tmp partition have noexec set (check /etc/fstab)? It's common
way to harden Linux installation, but people kind of abuses /tmp... it's
not for executions.


Jussi

On Sat, Jan 28, 2017 at 9:09 PM, Benoît Minisini <
[hidden email]> wrote:


> Le 28/01/2017 à 20:03, Benoît Minisini a écrit :
> > Le 28/01/2017 à 18:07, Marty a écrit :
> >> Want to run a script file packaged within the Gambas project. Tried the
> >> method below.
> >>
> >> DIM sTempScript as String
> >>
> >> sTempScript = Temp$
> >>
> >> COPY "update.sh" TO sTempscript
> >>
> >> SHELL sTempScript WAIT
> >>
> >> Does not work for me. All of the python files are in the gambas project
> >> directory and have execute permissions.
> >>
> >> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission denied
> >>
> >> What do I change to allow the python programs to run? Is it the project
> >> directory?
> >>
> >> Thanks,
> >> Marty
> >>
> >
> > Did you set execution rights on the shell file?
> >
>
> I mean on the copy. The permissions on the original file are ignored
> once you make an executable (they are all read-only and not executable).
>
> --
> Benoît Minisini
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>

------------------------------------------------------------------------------

Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user


If you reply to this email, your message will be added to the discussion below:

http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash-script-packaged-inside-gambas-tp20046p58348.html

To start a new topic under gambas-user, email [hidden email]
To unsubscribe from how-to execute file or bash script packaged inside gambas, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside Gambas

Jussi Lahtinen
Literally here: /tmp/gambas.1000/3092/1.tmp
Read the error message carefully!

Paste this into terminal and it will open the folder for you:
nemo /tmp/gambas.1000/3092/


Jussi

On Sat, Jan 28, 2017 at 11:25 PM, Marty <[hidden email]> wrote:

> Jussi,
>
>
>
> Thanks for your response. I’ve checked /etc/fstab and There are only two
> partitions the main and swap. I do not see any entry for a tmp partition.
> I’m running Gambas 3.91 under Mint17.1.
>
> Did a routine install when I installed it right from the CD.
>
>
>
> Bennoit,
>
>
>
> Thanks for your suggestion also. All of the files in the project directory
> have execute permissions set. Where is /tmp/Gambas located? I look at its
> permissions.
>
>
>
> Marty
>
>
>
> From: Jussi Lahtinen [via Gambas] [mailto:ml-node+s8142n58348h5@
> n7.nabble.com]
> Sent: Saturday, January 28, 2017 12:38 PM
> To: Marty <[hidden email]>
> Subject: Re: how-to execute file or bash script packaged inside gambas
>
>
>
> Also does the tmp partition have noexec set (check /etc/fstab)? It's common
> way to harden Linux installation, but people kind of abuses /tmp... it's
> not for executions.
>
>
> Jussi
>
> On Sat, Jan 28, 2017 at 9:09 PM, Benoît Minisini <
> [hidden email]> wrote:
>
>
> > Le 28/01/2017 à 20:03, Benoît Minisini a écrit :
> > > Le 28/01/2017 à 18:07, Marty a écrit :
> > >> Want to run a script file packaged within the Gambas project. Tried
> the
> > >> method below.
> > >>
> > >> DIM sTempScript as String
> > >>
> > >> sTempScript = Temp$
> > >>
> > >> COPY "update.sh" TO sTempscript
> > >>
> > >> SHELL sTempScript WAIT
> > >>
> > >> Does not work for me. All of the python files are in the gambas
> project
> > >> directory and have execute permissions.
> > >>
> > >> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission denied
> > >>
> > >> What do I change to allow the python programs to run? Is it the
> project
> > >> directory?
> > >>
> > >> Thanks,
> > >> Marty
> > >>
> > >
> > > Did you set execution rights on the shell file?
> > >
> >
> > I mean on the copy. The permissions on the original file are ignored
> > once you make an executable (they are all read-only and not executable).
> >
> > --
> > Benoît Minisini
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
>   _____
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash
> -script-packaged-inside-gambas-tp20046p58348.html
>
> To start a new topic under gambas-user, email
> [hidden email] <mailto:[hidden email]>
> To unsubscribe from how-to execute file or bash script packaged inside
> gambas, click here <http://gambas.8142.n7.nabble.
> com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=
> 20046&code=bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
>  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=macro_
> viewer&id=instant_html%21nabble%3Aemail.naml&base=
> nabble.naml.namespaces.BasicNamespace-nabble.view.web.
> template.NabbleNamespace-nabble.view.web.template.NodeNamesp
> ace&breadcrumbs=notify_subscribers%21nabble%3Aemail.
> naml-instant_emails%21nabble%3Aemail.naml-send_instant_
> email%21nabble%3Aemail.naml> NAML
>
>
>
>
>
> --
> View this message in context: http://gambas.8142.n7.nabble.c
> om/how-to-execute-file-or-bash-script-packaged-inside-gambas
> -tp20046p58349.html
> Sent from the gambas-user mailing list archive at Nabble.com.
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside gambas

Charlie
In reply to this post by Nicolas Koch
Here is a little program that copies a small 'sh' file from the program's folder and runs it.

Hope it helps.

runscript.tar

Check out www.gambas.one

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: how-to execute file or bash script packaged inside Gambas

Marty
In reply to this post by Jussi Lahtinen

Jussi,

 

I’ve found the answer. The file 1.tmp in directory /tmp/Gambas.1000/3092 is created at the time COPY "update.sh" TO sTempscript is executed. Because it is dynamically created it does not have execute permissions. After executing COPY "update.sh" TO sTempscript set the permissions on sTempscript to rwx using chmod. Then the script will run.

 

Now that caused another problem. The script passes parameters to a python program that is still in the project directory not in /tmp…. This causes a file not found error when the script executes. These temp files remain after the program exits. I should delete the when the program exits.

 

What should I do to work around the file not found error?

 

Marty

 

From: Jussi Lahtinen [via Gambas] [mailto:[hidden email]]
Sent: Saturday, January 28, 2017 4:36 PM
To: Marty <[hidden email]>
Subject: Re: how-to execute file or bash script packaged inside Gambas

 

Literally here: /tmp/gambas.1000/3092/1.tmp
Read the error message carefully!

Paste this into terminal and it will open the folder for you:
nemo /tmp/gambas.1000/3092/


Jussi

On Sat, Jan 28, 2017 at 11:25 PM, Marty <[hidden email]> wrote:


> Jussi,
>
>
>
> Thanks for your response. I’ve checked /etc/fstab and There are only two
> partitions the main and swap. I do not see any entry for a tmp partition.
> I’m running Gambas 3.91 under Mint17.1.
>
> Did a routine install when I installed it right from the CD.
>
>
>
> Bennoit,
>
>
>
> Thanks for your suggestion also. All of the files in the project directory
> have execute permissions set. Where is /tmp/Gambas located? I look at its
> permissions.
>
>
>
> Marty
>
>
>
> From: Jussi Lahtinen [via Gambas] [mailto:ml-node+s8142n58348h5@
> n7.nabble.com]
> Sent: Saturday, January 28, 2017 12:38 PM
> To: Marty <[hidden email]>
> Subject: Re: how-to execute file or bash script packaged inside gambas
>
>
>
> Also does the tmp partition have noexec set (check /etc/fstab)? It's common
> way to harden Linux installation, but people kind of abuses /tmp... it's
> not for executions.
>
>
> Jussi
>
> On Sat, Jan 28, 2017 at 9:09 PM, Benoît Minisini <
> [hidden email]> wrote:
>
>
> > Le 28/01/2017 à 20:03, Benoît Minisini a écrit :
> > > Le 28/01/2017 à 18:07, Marty a écrit :
> > >> Want to run a script file packaged within the Gambas project. Tried
> the
> > >> method below.
> > >>
> > >> DIM sTempScript as String
> > >>
> > >> sTempScript = Temp$
> > >>
> > >> COPY "update.sh" TO sTempscript
> > >>
> > >> SHELL sTempScript WAIT
> > >>
> > >> Does not work for me. All of the python files are in the gambas
> project
> > >> directory and have execute permissions.
> > >>
> > >> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission denied
> > >>
> > >> What do I change to allow the python programs to run? Is it the
> project
> > >> directory?
> > >>
> > >> Thanks,
> > >> Marty
> > >>
> > >
> > > Did you set execution rights on the shell file?
> > >
> >
> > I mean on the copy. The permissions on the original file are ignored
> > once you make an executable (they are all read-only and not executable).
> >
> > --
> > Benoît Minisini
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
>   _____
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash
> -script-packaged-inside-gambas-tp20046p58348.html
>
> To start a new topic under gambas-user, email
> [hidden email] <mailto:[hidden email]>
> To unsubscribe from how-to execute file or bash script packaged inside
> gambas, click here <http://gambas.8142.n7.nabble.
> com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=
> 20046&code=bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
>  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=macro_
> viewer&id=instant_html%21nabble%3Aemail.naml&base=
> nabble.naml.namespaces.BasicNamespace-nabble.view.web.
> template.NabbleNamespace-nabble.view.web.template.NodeNamesp
> ace&breadcrumbs=notify_subscribers%21nabble%3Aemail.
> naml-instant_emails%21nabble%3Aemail.naml-send_instant_
> email%21nabble%3Aemail.naml> NAML
>
>
>
>
>
> --
> View this message in context: http://gambas.8142.n7.nabble.c
> om/how-to-execute-file-or-bash-script-packaged-inside-gambas
> -tp20046p58349.html
> Sent from the gambas-user mailing list archive at Nabble.com.
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>

------------------------------------------------------------------------------

Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user


If you reply to this email, your message will be added to the discussion below:

http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash-script-packaged-inside-gambas-tp20046p58350.html

To start a new topic under gambas-user, email [hidden email]
To unsubscribe from how-to execute file or bash script packaged inside gambas, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside Gambas

Fabien Bodard-4
why a python program ?...

2017-01-29 15:22 GMT+01:00 Marty <[hidden email]>:

> Jussi,
>
>
>
> I’ve found the answer. The file 1.tmp in directory /tmp/Gambas.1000/3092 is created at the time COPY "update.sh" TO sTempscript is executed. Because it is dynamically created it does not have execute permissions. After executing COPY "update.sh" TO sTempscript set the permissions on sTempscript to rwx using chmod. Then the script will run.
>
>
>
> Now that caused another problem. The script passes parameters to a python program that is still in the project directory not in /tmp…. This causes a file not found error when the script executes. These temp files remain after the program exits. I should delete the when the program exits.
>
>
>
> What should I do to work around the file not found error?
>
>
>
> Marty
>
>
>
> From: Jussi Lahtinen [via Gambas] [mailto:[hidden email]]
> Sent: Saturday, January 28, 2017 4:36 PM
> To: Marty <[hidden email]>
> Subject: Re: how-to execute file or bash script packaged inside Gambas
>
>
>
> Literally here: /tmp/gambas.1000/3092/1.tmp
> Read the error message carefully!
>
> Paste this into terminal and it will open the folder for you:
> nemo /tmp/gambas.1000/3092/
>
>
> Jussi
>
> On Sat, Jan 28, 2017 at 11:25 PM, Marty <[hidden email]> wrote:
>
>
>> Jussi,
>>
>>
>>
>> Thanks for your response. I’ve checked /etc/fstab and There are only two
>> partitions the main and swap. I do not see any entry for a tmp partition.
>> I’m running Gambas 3.91 under Mint17.1.
>>
>> Did a routine install when I installed it right from the CD.
>>
>>
>>
>> Bennoit,
>>
>>
>>
>> Thanks for your suggestion also. All of the files in the project directory
>> have execute permissions set. Where is /tmp/Gambas located? I look at its
>> permissions.
>>
>>
>>
>> Marty
>>
>>
>>
>> From: Jussi Lahtinen [via Gambas] [mailto:ml-node+s8142n58348h5@
>> n7.nabble.com]
>> Sent: Saturday, January 28, 2017 12:38 PM
>> To: Marty <[hidden email]>
>> Subject: Re: how-to execute file or bash script packaged inside gambas
>>
>>
>>
>> Also does the tmp partition have noexec set (check /etc/fstab)? It's common
>> way to harden Linux installation, but people kind of abuses /tmp... it's
>> not for executions.
>>
>>
>> Jussi
>>
>> On Sat, Jan 28, 2017 at 9:09 PM, Benoît Minisini <
>> [hidden email]> wrote:
>>
>>
>> > Le 28/01/2017 à 20:03, Benoît Minisini a écrit :
>> > > Le 28/01/2017 à 18:07, Marty a écrit :
>> > >> Want to run a script file packaged within the Gambas project. Tried
>> the
>> > >> method below.
>> > >>
>> > >> DIM sTempScript as String
>> > >>
>> > >> sTempScript = Temp$
>> > >>
>> > >> COPY "update.sh" TO sTempscript
>> > >>
>> > >> SHELL sTempScript WAIT
>> > >>
>> > >> Does not work for me. All of the python files are in the gambas
>> project
>> > >> directory and have execute permissions.
>> > >>
>> > >> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission denied
>> > >>
>> > >> What do I change to allow the python programs to run? Is it the
>> project
>> > >> directory?
>> > >>
>> > >> Thanks,
>> > >> Marty
>> > >>
>> > >
>> > > Did you set execution rights on the shell file?
>> > >
>> >
>> > I mean on the copy. The permissions on the original file are ignored
>> > once you make an executable (they are all read-only and not executable).
>> >
>> > --
>> > Benoît Minisini
>> >
>> > ------------------------------------------------------------
>> > ------------------
>> > Check out the vibrant tech community on one of the world's most
>> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> > _______________________________________________
>> > Gambas-user mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>>
>>
>>   _____
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash
>> -script-packaged-inside-gambas-tp20046p58348.html
>>
>> To start a new topic under gambas-user, email
>> [hidden email] <mailto:[hidden email]>
>> To unsubscribe from how-to execute file or bash script packaged inside
>> gambas, click here <http://gambas.8142.n7.nabble.
>> com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=
>> 20046&code=bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
>>  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=macro_
>> viewer&id=instant_html%21nabble%3Aemail.naml&base=
>> nabble.naml.namespaces.BasicNamespace-nabble.view.web.
>> template.NabbleNamespace-nabble.view.web.template.NodeNamesp
>> ace&breadcrumbs=notify_subscribers%21nabble%3Aemail.
>> naml-instant_emails%21nabble%3Aemail.naml-send_instant_
>> email%21nabble%3Aemail.naml> NAML
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://gambas.8142.n7.nabble.c
>> om/how-to-execute-file-or-bash-script-packaged-inside-gambas
>> -tp20046p58349.html
>> Sent from the gambas-user mailing list archive at Nabble.com.
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
>   _____
>
> If you reply to this email, your message will be added to the discussion below:
>
> http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash-script-packaged-inside-gambas-tp20046p58350.html
>
> To start a new topic under gambas-user, email [hidden email] <mailto:[hidden email]>
> To unsubscribe from how-to execute file or bash script packaged inside gambas, click here < .
>  <
http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> NAML
>
>
>
>
>
> --
> View this message in context: http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash-script-packaged-inside-gambas-tp20046p58352.html
> Sent from the gambas-user mailing list archive at Nabble.com.
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user



--
Fabien Bodard

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside Gambas

gbwilly
In reply to this post by Marty
On 2017-01-29 15:22, Marty wrote:

> Jussi,
>
>
>
> I’ve found the answer. The file 1.tmp in directory
> /tmp/Gambas.1000/3092 is created at the time COPY "update.sh" TO
> sTempscript is executed. Because it is dynamically created it does not
> have execute permissions. After executing COPY "update.sh" TO
> sTempscript set the permissions on sTempscript to rwx using chmod.
> Then the script will run.
>
>
>
> Now that caused another problem. The script passes parameters to a
> python program that is still in the project directory not in /tmp….
> This causes a file not found error when the script executes. These
> temp files remain after the program exits. I should delete the when
> the program exits.
>
>
>
> What should I do to work around the file not found error?
>
>
>
> Marty
>
Hi Marty,

If you have this application for personal use on your own system this is
what I would do:

1. Copy (as root) the update.sh and python program to /usr/bin
2. chmod 755 both the .sh and phyton program.
3. In you application refer to the /usr/bin/update.sh script.

Now your application should run just fine.


If on the other hand you want to distribute this you need to do as
follows:

1. Put both the update.sh and phyton program in your .hidden project
folder (named Project in IDE).
2. Make a package and in 'step 8. Extra files' of the packager add your
update.sh and let if be placed in /usr/bin during installation time. Do
the same for the phyton program.
3. Install the package on an other system to test and you will find both
your update.sh and phyton program in /usr/bin with proper priveledges,
after installation.

Your application should now run fine on the other system, without any
manual interference by you.


One thing you need to understand is that refering to files located in
the project Data folder will ALWAYS be read-only access once the gambas
executable of the project is made.

So follow the common linux way of organising things.
Place sripts in /usr/bin (this is where stuff gets executed), common
application stuff (like icons and stuff that needs to be read-only
accesible) could be in /usr/share.

If you need read/write acces your application needs to create these
files in the users home folder as that is the only place the user
running the application will have read/write access.

When developing you application, on the development system you need to
do this manualy for testing while developing.
Once distributing your application you use step 8 in package manager to
make sure all is at its proper location after installing the package.

Hope this helps,

gbWilly


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: how-to execute file or bash script packaged inside Gambas

Marty
In reply to this post by Fabien Bodard-4

Fabien,

 

I’m writing a control program that has one of its parts a window to display the bandspread form a radio receiver. The python program does this well. No need to reinvent the wheel. Hope this answers your question.

 

Marty

 

From: Fabien Bodard-4 [via Gambas] [mailto:[hidden email]]
Sent: Sunday, January 29, 2017 10:11 AM
To: Marty <[hidden email]>
Subject: Re: how-to execute file or bash script packaged inside Gambas

 

why a python program ?...

2017-01-29 15:22 GMT+01:00 Marty <[hidden email]>:


> Jussi,
>
>
>
> I’ve found the answer. The file 1.tmp in directory /tmp/Gambas.1000/3092 is created at the time COPY "update.sh" TO sTempscript is executed. Because it is dynamically created it does not have execute permissions. After executing COPY "update.sh" TO sTempscript set the permissions on sTempscript to rwx using chmod. Then the script will run.
>
>
>
> Now that caused another problem. The script passes parameters to a python program that is still in the project directory not in /tmp…. This causes a file not found error when the script executes. These temp files remain after the program exits. I should delete the when the program exits.
>
>
>
> What should I do to work around the file not found error?
>
>
>
> Marty
>
>
>
> From: Jussi Lahtinen [via Gambas] [mailto:[hidden email]]
> Sent: Saturday, January 28, 2017 4:36 PM
> To: Marty <[hidden email]>
> Subject: Re: how-to execute file or bash script packaged inside Gambas
>
>
>
> Literally here: /tmp/gambas.1000/3092/1.tmp
> Read the error message carefully!
>
> Paste this into terminal and it will open the folder for you:
> nemo /tmp/gambas.1000/3092/
>
>
> Jussi
>
> On Sat, Jan 28, 2017 at 11:25 PM, Marty <[hidden email]> wrote:
>
>
>> Jussi,
>>
>>
>>
>> Thanks for your response. I’ve checked /etc/fstab and There are only two
>> partitions the main and swap. I do not see any entry for a tmp partition.
>> I’m running Gambas 3.91 under Mint17.1.
>>
>> Did a routine install when I installed it right from the CD.
>>
>>
>>
>> Bennoit,
>>
>>
>>
>> Thanks for your suggestion also. All of the files in the project directory
>> have execute permissions set. Where is /tmp/Gambas located? I look at its
>> permissions.
>>
>>
>>
>> Marty
>>
>>
>>
>> From: Jussi Lahtinen [via Gambas] [mailto:ml-node+s8142n58348h5@
>> n7.nabble.com]
>> Sent: Saturday, January 28, 2017 12:38 PM
>> To: Marty <[hidden email]>
>> Subject: Re: how-to execute file or bash script packaged inside gambas
>>
>>
>>
>> Also does the tmp partition have noexec set (check /etc/fstab)? It's common
>> way to harden Linux installation, but people kind of abuses /tmp... it's
>> not for executions.
>>
>>
>> Jussi
>>
>> On Sat, Jan 28, 2017 at 9:09 PM, Benoît Minisini <
>> [hidden email]> wrote:
>>
>>
>> > Le 28/01/2017 à 20:03, Benoît Minisini a écrit :
>> > > Le 28/01/2017 à 18:07, Marty a écrit :
>> > >> Want to run a script file packaged within the Gambas project. Tried
>> the
>> > >> method below.
>> > >>
>> > >> DIM sTempScript as String
>> > >>
>> > >> sTempScript = Temp$
>> > >>
>> > >> COPY "update.sh" TO sTempscript
>> > >>
>> > >> SHELL sTempScript WAIT
>> > >>
>> > >> Does not work for me. All of the python files are in the gambas
>> project
>> > >> directory and have execute permissions.
>> > >>
>> > >> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission denied
>> > >>
>> > >> What do I change to allow the python programs to run? Is it the
>> project
>> > >> directory?
>> > >>
>> > >> Thanks,
>> > >> Marty
>> > >>
>> > >
>> > > Did you set execution rights on the shell file?
>> > >
>> >
>> > I mean on the copy. The permissions on the original file are ignored
>> > once you make an executable (they are all read-only and not executable).
>> >
>> > --
>> > Benoît Minisini
>> >
>> > ------------------------------------------------------------
>> > ------------------
>> > Check out the vibrant tech community on one of the world's most
>> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> > _______________________________________________
>> > Gambas-user mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>>
>>
>>   _____
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash
>> -script-packaged-inside-gambas-tp20046p58348.html
>>
>> To start a new topic under gambas-user, email
>> [hidden email] <[hidden email]>
>> To unsubscribe from how-to execute file or bash script packaged inside
>> gambas, click here <http://gambas.8142.n7.nabble.
>> com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=
>> 20046&code=bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
>>  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=macro_
>> viewer&id=instant_html%21nabble%3Aemail.naml&base=
>> nabble.naml.namespaces.BasicNamespace-nabble.view.web.
>> template.NabbleNamespace-nabble.view.web.template.NodeNamesp
>> ace&breadcrumbs=notify_subscribers%21nabble%3Aemail.
>> naml-instant_emails%21nabble%3Aemail.naml-send_instant_
>> email%21nabble%3Aemail.naml> NAML
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://gambas.8142.n7.nabble.c
>> om/how-to-execute-file-or-bash-script-packaged-inside-gambas
>> -tp20046p58349.html
>> Sent from the gambas-user mailing list archive at Nabble.com.
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
>   _____
>
> If you reply to this email, your message will be added to the discussion below:
>
> http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash-script-packaged-inside-gambas-tp20046p58350.html
>
> To start a new topic under gambas-user, email [hidden email] <mailto:[hidden email]>
> To unsubscribe from how-to execute file or bash script packaged inside gambas, click here < .
>  <
http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> NAML
>
>
>
>
>
> --
> View this message in context: http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash-script-packaged-inside-gambas-tp20046p58352.html
> Sent from the gambas-user mailing list archive at Nabble.com.
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user



--
Fabien Bodard

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user


If you reply to this email, your message will be added to the discussion below:

http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash-script-packaged-inside-gambas-tp20046p58353.html

To start a new topic under gambas-user, email [hidden email]
To unsubscribe from how-to execute file or bash script packaged inside gambas, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside Gambas

Jussi Lahtinen
In reply to this post by Marty
I suggest you copy the script and the python executables in dedicated
folder made by your program.
Example your program could create:

/home/MyProgram/scripts
Or
/home/MyProgram/tmp

And copy things there for the execution. Do you really need to remove the
scripts after execution or are they executed every time with the program?



Jussi



On Sun, Jan 29, 2017 at 4:22 PM, Marty <[hidden email]> wrote:

> Jussi,
>
>
>
> I’ve found the answer. The file 1.tmp in directory /tmp/Gambas.1000/3092
> is created at the time COPY "update.sh" TO sTempscript is executed. Because
> it is dynamically created it does not have execute permissions. After
> executing COPY "update.sh" TO sTempscript set the permissions on
> sTempscript to rwx using chmod. Then the script will run.
>
>
>
> Now that caused another problem. The script passes parameters to a python
> program that is still in the project directory not in /tmp…. This causes a
> file not found error when the script executes. These temp files remain
> after the program exits. I should delete the when the program exits.
>
>
>
> What should I do to work around the file not found error?
>
>
>
> Marty
>
>
>
> From: Jussi Lahtinen [via Gambas] [mailto:ml-node+
> [hidden email]]
> Sent: Saturday, January 28, 2017 4:36 PM
> To: Marty <[hidden email]>
> Subject: Re: how-to execute file or bash script packaged inside Gambas
>
>
>
> Literally here: /tmp/gambas.1000/3092/1.tmp
> Read the error message carefully!
>
> Paste this into terminal and it will open the folder for you:
> nemo /tmp/gambas.1000/3092/
>
>
> Jussi
>
> On Sat, Jan 28, 2017 at 11:25 PM, Marty <[hidden email]> wrote:
>
>
> > Jussi,
> >
> >
> >
> > Thanks for your response. I’ve checked /etc/fstab and There are only two
> > partitions the main and swap. I do not see any entry for a tmp partition.
> > I’m running Gambas 3.91 under Mint17.1.
> >
> > Did a routine install when I installed it right from the CD.
> >
> >
> >
> > Bennoit,
> >
> >
> >
> > Thanks for your suggestion also. All of the files in the project
> directory
> > have execute permissions set. Where is /tmp/Gambas located? I look at its
> > permissions.
> >
> >
> >
> > Marty
> >
> >
> >
> > From: Jussi Lahtinen [via Gambas] [mailto:ml-node+s8142n58348h5@
> > n7.nabble.com]
> > Sent: Saturday, January 28, 2017 12:38 PM
> > To: Marty <[hidden email]>
> > Subject: Re: how-to execute file or bash script packaged inside gambas
> >
> >
> >
> > Also does the tmp partition have noexec set (check /etc/fstab)? It's
> common
> > way to harden Linux installation, but people kind of abuses /tmp... it's
> > not for executions.
> >
> >
> > Jussi
> >
> > On Sat, Jan 28, 2017 at 9:09 PM, Benoît Minisini <
> > [hidden email]> wrote:
> >
> >
> > > Le 28/01/2017 à 20:03, Benoît Minisini a écrit :
> > > > Le 28/01/2017 à 18:07, Marty a écrit :
> > > >> Want to run a script file packaged within the Gambas project. Tried
> > the
> > > >> method below.
> > > >>
> > > >> DIM sTempScript as String
> > > >>
> > > >> sTempScript = Temp$
> > > >>
> > > >> COPY "update.sh" TO sTempscript
> > > >>
> > > >> SHELL sTempScript WAIT
> > > >>
> > > >> Does not work for me. All of the python files are in the gambas
> > project
> > > >> directory and have execute permissions.
> > > >>
> > > >> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission
> denied
> > > >>
> > > >> What do I change to allow the python programs to run? Is it the
> > project
> > > >> directory?
> > > >>
> > > >> Thanks,
> > > >> Marty
> > > >>
> > > >
> > > > Did you set execution rights on the shell file?
> > > >
> > >
> > > I mean on the copy. The permissions on the original file are ignored
> > > once you make an executable (they are all read-only and not
> executable).
> > >
> > > --
> > > Benoît Minisini
> > >
> > > ------------------------------------------------------------
> > > ------------------
> > > Check out the vibrant tech community on one of the world's most
> > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > > _______________________________________________
> > > Gambas-user mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> >
> >
> >   _____
> >
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> > http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash
> > -script-packaged-inside-gambas-tp20046p58348.html
> >
> > To start a new topic under gambas-user, email
> > [hidden email] <mailto:[hidden email]>
> > To unsubscribe from how-to execute file or bash script packaged inside
> > gambas, click here <http://gambas.8142.n7.nabble.
> > com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=
> > 20046&code=bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
> >  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=macro_
> > viewer&id=instant_html%21nabble%3Aemail.naml&base=
> > nabble.naml.namespaces.BasicNamespace-nabble.view.web.
> > template.NabbleNamespace-nabble.view.web.template.NodeNamesp
> > ace&breadcrumbs=notify_subscribers%21nabble%3Aemail.
> > naml-instant_emails%21nabble%3Aemail.naml-send_instant_
> > email%21nabble%3Aemail.naml> NAML
> >
> >
> >
> >
> >
> > --
> > View this message in context: http://gambas.8142.n7.nabble.c
> > om/how-to-execute-file-or-bash-script-packaged-inside-gambas
> > -tp20046p58349.html
> > Sent from the gambas-user mailing list archive at Nabble.com.
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
>   _____
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://gambas.8142.n7.nabble.com/how-to-execute-file-or-
> bash-script-packaged-inside-gambas-tp20046p58350.html
>
> To start a new topic under gambas-user, email
> [hidden email] <mailto:[hidden email]>
> To unsubscribe from how-to execute file or bash script packaged inside
> gambas, click here <http://gambas.8142.n7.nabble.
> com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=20046&code=
> bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
>  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?
> macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&
> base=nabble.naml.namespaces.BasicNamespace-nabble.view.
> web.template.NabbleNamespace-nabble.view.web.template.
> NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
> 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
> instant_email%21nabble%3Aemail.naml> NAML
>
>
>
>
>
> --
> View this message in context: http://gambas.8142.n7.nabble.
> com/how-to-execute-file-or-bash-script-packaged-inside-
> gambas-tp20046p58352.html
> Sent from the gambas-user mailing list archive at Nabble.com.
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: how-to execute file or bash script packaged inside Gambas

Marty

Jussi,

 

Sounds simple enough. Should the tmp directory be in the user’s home directory? If so is there a way Gambas can “know” the user id in order to create the directory?

No, the files do not need to be deleted after each run if not in /tmp/Gambas.1000…

 

Marty

 

From: Jussi Lahtinen [via Gambas] [mailto:[hidden email]]
Sent: Sunday, January 29, 2017 3:08 PM
To: Marty <[hidden email]>
Subject: Re: how-to execute file or bash script packaged inside Gambas

 

I suggest you copy the script and the python executables in dedicated
folder made by your program.
Example your program could create:

/home/MyProgram/scripts
Or
/home/MyProgram/tmp

And copy things there for the execution. Do you really need to remove the
scripts after execution or are they executed every time with the program?



Jussi



On Sun, Jan 29, 2017 at 4:22 PM, Marty <[hidden email]> wrote:


> Jussi,
>
>
>
> I’ve found the answer. The file 1.tmp in directory /tmp/Gambas.1000/3092
> is created at the time COPY "update.sh" TO sTempscript is executed. Because
> it is dynamically created it does not have execute permissions. After
> executing COPY "update.sh" TO sTempscript set the permissions on
> sTempscript to rwx using chmod. Then the script will run.
>
>
>
> Now that caused another problem. The script passes parameters to a python
> program that is still in the project directory not in /tmp…. This causes a
> file not found error when the script executes. These temp files remain
> after the program exits. I should delete the when the program exits.
>
>
>
> What should I do to work around the file not found error?
>
>
>
> Marty
>
>
>
> From: Jussi Lahtinen [via Gambas] [mailto:ml-node+
> [hidden email]]
> Sent: Saturday, January 28, 2017 4:36 PM
> To: Marty <[hidden email]>
> Subject: Re: how-to execute file or bash script packaged inside Gambas
>
>
>
> Literally here: /tmp/gambas.1000/3092/1.tmp
> Read the error message carefully!
>
> Paste this into terminal and it will open the folder for you:
> nemo /tmp/gambas.1000/3092/
>
>
> Jussi
>
> On Sat, Jan 28, 2017 at 11:25 PM, Marty <[hidden email]> wrote:
>
>
> > Jussi,
> >
> >
> >
> > Thanks for your response. I’ve checked /etc/fstab and There are only two
> > partitions the main and swap. I do not see any entry for a tmp partition.
> > I’m running Gambas 3.91 under Mint17.1.
> >
> > Did a routine install when I installed it right from the CD.
> >
> >
> >
> > Bennoit,
> >
> >
> >
> > Thanks for your suggestion also. All of the files in the project
> directory
> > have execute permissions set. Where is /tmp/Gambas located? I look at its
> > permissions.
> >
> >
> >
> > Marty
> >
> >
> >
> > From: Jussi Lahtinen [via Gambas] [mailto:ml-node+s8142n58348h5@
> > n7.nabble.com]
> > Sent: Saturday, January 28, 2017 12:38 PM
> > To: Marty <[hidden email]>
> > Subject: Re: how-to execute file or bash script packaged inside gambas
> >
> >
> >
> > Also does the tmp partition have noexec set (check /etc/fstab)? It's
> common
> > way to harden Linux installation, but people kind of abuses /tmp... it's
> > not for executions.
> >
> >
> > Jussi
> >
> > On Sat, Jan 28, 2017 at 9:09 PM, Benoît Minisini <
> > [hidden email]> wrote:
> >
> >
> > > Le 28/01/2017 à 20:03, Benoît Minisini a écrit :
> > > > Le 28/01/2017 à 18:07, Marty a écrit :
> > > >> Want to run a script file packaged within the Gambas project. Tried
> > the
> > > >> method below.
> > > >>
> > > >> DIM sTempScript as String
> > > >>
> > > >> sTempScript = Temp$
> > > >>
> > > >> COPY "update.sh" TO sTempscript
> > > >>
> > > >> SHELL sTempScript WAIT
> > > >>
> > > >> Does not work for me. All of the python files are in the gambas
> > project
> > > >> directory and have execute permissions.
> > > >>
> > > >> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission
> denied
> > > >>
> > > >> What do I change to allow the python programs to run? Is it the
> > project
> > > >> directory?
> > > >>
> > > >> Thanks,
> > > >> Marty
> > > >>
> > > >
> > > > Did you set execution rights on the shell file?
> > > >
> > >
> > > I mean on the copy. The permissions on the original file are ignored
> > > once you make an executable (they are all read-only and not
> executable).
> > >
> > > --
> > > Benoît Minisini
> > >
> > > ------------------------------------------------------------
> > > ------------------
> > > Check out the vibrant tech community on one of the world's most
> > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > > _______________________________________________
> > > Gambas-user mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> >
> >
> >   _____
> >
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> > http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash
> > -script-packaged-inside-gambas-tp20046p58348.html
> >
> > To start a new topic under gambas-user, email
> > [hidden email] <[hidden email]>
> > To unsubscribe from how-to execute file or bash script packaged inside
> > gambas, click here <http://gambas.8142.n7.nabble.
> > com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=
> > 20046&code=bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
> >  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=macro_
> > viewer&id=instant_html%21nabble%3Aemail.naml&base=
> > nabble.naml.namespaces.BasicNamespace-nabble.view.web.
> > template.NabbleNamespace-nabble.view.web.template.NodeNamesp
> > ace&breadcrumbs=notify_subscribers%21nabble%3Aemail.
> > naml-instant_emails%21nabble%3Aemail.naml-send_instant_
> > email%21nabble%3Aemail.naml> NAML
> >
> >
> >
> >
> >
> > --
> > View this message in context: http://gambas.8142.n7.nabble.c
> > om/how-to-execute-file-or-bash-script-packaged-inside-gambas
> > -tp20046p58349.html
> > Sent from the gambas-user mailing list archive at Nabble.com.
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
>   _____
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://gambas.8142.n7.nabble.com/how-to-execute-file-or-
> bash-script-packaged-inside-gambas-tp20046p58350.html
>
> To start a new topic under gambas-user, email
> [hidden email] <mailto:[hidden email]>
> To unsubscribe from how-to execute file or bash script packaged inside
> gambas, click here <http://gambas.8142.n7.nabble.
> com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=20046&code=
> bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
>  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?
> macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&
> base=nabble.naml.namespaces.BasicNamespace-nabble.view.
> web.template.NabbleNamespace-nabble.view.web.template.
> NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
> 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
> instant_email%21nabble%3Aemail.naml> NAML
>
>
>
>
>
> --
> View this message in context: http://gambas.8142.n7.nabble.
> com/how-to-execute-file-or-bash-script-packaged-inside-
> gambas-tp20046p58352.html
> Sent from the gambas-user mailing list archive at Nabble.com.
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>

------------------------------------------------------------------------------

Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user


If you reply to this email, your message will be added to the discussion below:

http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash-script-packaged-inside-gambas-tp20046p58356.html

To start a new topic under gambas-user, email [hidden email]
To unsubscribe from how-to execute file or bash script packaged inside gambas, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside Gambas

Jussi Lahtinen
Well I would avoid executing things in /tmp and there is no sense in asking
root permission to put it in /usr/bin or so.
So directory in home is good option. System.User.Home gives you what you
need.


Jussi



On Mon, Jan 30, 2017 at 1:07 AM, Marty <[hidden email]> wrote:

> Jussi,
>
>
>
> Sounds simple enough. Should the tmp directory be in the user’s home
> directory? If so is there a way Gambas can “know” the user id in order to
> create the directory?
>
> No, the files do not need to be deleted after each run if not in
> /tmp/Gambas.1000…
>
>
>
> Marty
>
>
>
> From: Jussi Lahtinen [via Gambas] [mailto:ml-node+
> [hidden email]]
> Sent: Sunday, January 29, 2017 3:08 PM
> To: Marty <[hidden email]>
> Subject: Re: how-to execute file or bash script packaged inside Gambas
>
>
>
> I suggest you copy the script and the python executables in dedicated
> folder made by your program.
> Example your program could create:
>
> /home/MyProgram/scripts
> Or
> /home/MyProgram/tmp
>
> And copy things there for the execution. Do you really need to remove the
> scripts after execution or are they executed every time with the program?
>
>
>
> Jussi
>
>
>
> On Sun, Jan 29, 2017 at 4:22 PM, Marty <[hidden email]> wrote:
>
>
> > Jussi,
> >
> >
> >
> > I’ve found the answer. The file 1.tmp in directory /tmp/Gambas.1000/3092
> > is created at the time COPY "update.sh" TO sTempscript is executed.
> Because
> > it is dynamically created it does not have execute permissions. After
> > executing COPY "update.sh" TO sTempscript set the permissions on
> > sTempscript to rwx using chmod. Then the script will run.
> >
> >
> >
> > Now that caused another problem. The script passes parameters to a python
> > program that is still in the project directory not in /tmp…. This causes
> a
> > file not found error when the script executes. These temp files remain
> > after the program exits. I should delete the when the program exits.
> >
> >
> >
> > What should I do to work around the file not found error?
> >
> >
> >
> > Marty
> >
> >
> >
> > From: Jussi Lahtinen [via Gambas] [mailto:ml-node+
> > [hidden email]]
> > Sent: Saturday, January 28, 2017 4:36 PM
> > To: Marty <[hidden email]>
> > Subject: Re: how-to execute file or bash script packaged inside Gambas
> >
> >
> >
> > Literally here: /tmp/gambas.1000/3092/1.tmp
> > Read the error message carefully!
> >
> > Paste this into terminal and it will open the folder for you:
> > nemo /tmp/gambas.1000/3092/
> >
> >
> > Jussi
> >
> > On Sat, Jan 28, 2017 at 11:25 PM, Marty <[hidden email]> wrote:
> >
> >
> > > Jussi,
> > >
> > >
> > >
> > > Thanks for your response. I’ve checked /etc/fstab and There are only
> two
> > > partitions the main and swap. I do not see any entry for a tmp
> partition.
> > > I’m running Gambas 3.91 under Mint17.1.
> > >
> > > Did a routine install when I installed it right from the CD.
> > >
> > >
> > >
> > > Bennoit,
> > >
> > >
> > >
> > > Thanks for your suggestion also. All of the files in the project
> > directory
> > > have execute permissions set. Where is /tmp/Gambas located? I look at
> its
> > > permissions.
> > >
> > >
> > >
> > > Marty
> > >
> > >
> > >
> > > From: Jussi Lahtinen [via Gambas] [mailto:ml-node+s8142n58348h5@
> > > n7.nabble.com]
> > > Sent: Saturday, January 28, 2017 12:38 PM
> > > To: Marty <[hidden email]>
> > > Subject: Re: how-to execute file or bash script packaged inside gambas
> > >
> > >
> > >
> > > Also does the tmp partition have noexec set (check /etc/fstab)? It's
> > common
> > > way to harden Linux installation, but people kind of abuses /tmp...
> it's
> > > not for executions.
> > >
> > >
> > > Jussi
> > >
> > > On Sat, Jan 28, 2017 at 9:09 PM, Benoît Minisini <
> > > [hidden email]> wrote:
> > >
> > >
> > > > Le 28/01/2017 à 20:03, Benoît Minisini a écrit :
> > > > > Le 28/01/2017 à 18:07, Marty a écrit :
> > > > >> Want to run a script file packaged within the Gambas project.
> Tried
> > > the
> > > > >> method below.
> > > > >>
> > > > >> DIM sTempScript as String
> > > > >>
> > > > >> sTempScript = Temp$
> > > > >>
> > > > >> COPY "update.sh" TO sTempscript
> > > > >>
> > > > >> SHELL sTempScript WAIT
> > > > >>
> > > > >> Does not work for me. All of the python files are in the gambas
> > > project
> > > > >> directory and have execute permissions.
> > > > >>
> > > > >> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission
> > denied
> > > > >>
> > > > >> What do I change to allow the python programs to run? Is it the
> > > project
> > > > >> directory?
> > > > >>
> > > > >> Thanks,
> > > > >> Marty
> > > > >>
> > > > >
> > > > > Did you set execution rights on the shell file?
> > > > >
> > > >
> > > > I mean on the copy. The permissions on the original file are ignored
> > > > once you make an executable (they are all read-only and not
> > executable).
> > > >
> > > > --
> > > > Benoît Minisini
> > > >
> > > > ------------------------------------------------------------
> > > > ------------------
> > > > Check out the vibrant tech community on one of the world's most
> > > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > > > _______________________________________________
> > > > Gambas-user mailing list
> > > > [hidden email]
> > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > > >
> > >
> > > ------------------------------------------------------------
> > > ------------------
> > > Check out the vibrant tech community on one of the world's most
> > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > > _______________________________________________
> > > Gambas-user mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> > >
> > >
> > >   _____
> > >
> > > If you reply to this email, your message will be added to the
> discussion
> > > below:
> > >
> > > http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash
> > > -script-packaged-inside-gambas-tp20046p58348.html
> > >
> > > To start a new topic under gambas-user, email
> > > [hidden email] <mailto:[hidden email] <mailto:[hidden%20email]> >
> > > To unsubscribe from how-to execute file or bash script packaged inside
> > > gambas, click here <http://gambas.8142.n7.nabble.
> > > com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=
> > > 20046&code=bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
> > >  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?
> macro=macro_
> > > viewer&id=instant_html%21nabble%3Aemail.naml&base=
> > > nabble.naml.namespaces.BasicNamespace-nabble.view.web.
> > > template.NabbleNamespace-nabble.view.web.template.NodeNamesp
> > > ace&breadcrumbs=notify_subscribers%21nabble%3Aemail.
> > > naml-instant_emails%21nabble%3Aemail.naml-send_instant_
> > > email%21nabble%3Aemail.naml> NAML
> > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context: http://gambas.8142.n7.nabble.c
> > > om/how-to-execute-file-or-bash-script-packaged-inside-gambas
> > > -tp20046p58349.html
> > > Sent from the gambas-user mailing list archive at Nabble.com.
> > > ------------------------------------------------------------
> > > ------------------
> > > Check out the vibrant tech community on one of the world's most
> > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > > _______________________________________________
> > > Gambas-user mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> >
> >
> >   _____
> >
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> > http://gambas.8142.n7.nabble.com/how-to-execute-file-or-
> > bash-script-packaged-inside-gambas-tp20046p58350.html
> >
> > To start a new topic under gambas-user, email
> > [hidden email] <mailto:[hidden email]>
> > To unsubscribe from how-to execute file or bash script packaged inside
> > gambas, click here <http://gambas.8142.n7.nabble.
> > com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=20046&code=
> > bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
> >  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?
> > macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&
> > base=nabble.naml.namespaces.BasicNamespace-nabble.view.
> > web.template.NabbleNamespace-nabble.view.web.template.
> > NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
> > 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
> > instant_email%21nabble%3Aemail.naml> NAML
> >
> >
> >
> >
> >
> > --
> > View this message in context: http://gambas.8142.n7.nabble.
> > com/how-to-execute-file-or-bash-script-packaged-inside-
> > gambas-tp20046p58352.html
> > Sent from the gambas-user mailing list archive at Nabble.com.
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
>   _____
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://gambas.8142.n7.nabble.com/how-to-execute-file-or-
> bash-script-packaged-inside-gambas-tp20046p58356.html
>
> To start a new topic under gambas-user, email
> [hidden email] <mailto:[hidden email]>
> To unsubscribe from how-to execute file or bash script packaged inside
> gambas, click here <http://gambas.8142.n7.nabble.
> com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=20046&code=
> bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
>  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?
> macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&
> base=nabble.naml.namespaces.BasicNamespace-nabble.view.
> web.template.NabbleNamespace-nabble.view.web.template.
> NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
> 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
> instant_email%21nabble%3Aemail.naml> NAML
>
>
>
>
>
> --
> View this message in context: http://gambas.8142.n7.nabble.
> com/how-to-execute-file-or-bash-script-packaged-inside-
> gambas-tp20046p58357.html
> Sent from the gambas-user mailing list archive at Nabble.com.
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how-to execute file or bash script packaged inside Gambas

Fabien Bodard-4
Use:

User.Home &/  ".cache/gambas3/yourprogram"

Or

User.Home &/  ".cache/yourprogram"

.cache is the standard for cached parts of programs. For example I use
~/.cache/gb.map for caching gb.map tiles



2017-01-30 5:08 GMT+01:00 Jussi Lahtinen <[hidden email]>:

> Well I would avoid executing things in /tmp and there is no sense in asking
> root permission to put it in /usr/bin or so.
> So directory in home is good option. System.User.Home gives you what you
> need.
>
>
> Jussi
>
>
>
> On Mon, Jan 30, 2017 at 1:07 AM, Marty <[hidden email]> wrote:
>
>> Jussi,
>>
>>
>>
>> Sounds simple enough. Should the tmp directory be in the user’s home
>> directory? If so is there a way Gambas can “know” the user id in order to
>> create the directory?
>>
>> No, the files do not need to be deleted after each run if not in
>> /tmp/Gambas.1000…
>>
>>
>>
>> Marty
>>
>>
>>
>> From: Jussi Lahtinen [via Gambas] [mailto:ml-node+
>> [hidden email]]
>> Sent: Sunday, January 29, 2017 3:08 PM
>> To: Marty <[hidden email]>
>> Subject: Re: how-to execute file or bash script packaged inside Gambas
>>
>>
>>
>> I suggest you copy the script and the python executables in dedicated
>> folder made by your program.
>> Example your program could create:
>>
>> /home/MyProgram/scripts
>> Or
>> /home/MyProgram/tmp
>>
>> And copy things there for the execution. Do you really need to remove the
>> scripts after execution or are they executed every time with the program?
>>
>>
>>
>> Jussi
>>
>>
>>
>> On Sun, Jan 29, 2017 at 4:22 PM, Marty <[hidden email]> wrote:
>>
>>
>> > Jussi,
>> >
>> >
>> >
>> > I’ve found the answer. The file 1.tmp in directory /tmp/Gambas.1000/3092
>> > is created at the time COPY "update.sh" TO sTempscript is executed.
>> Because
>> > it is dynamically created it does not have execute permissions. After
>> > executing COPY "update.sh" TO sTempscript set the permissions on
>> > sTempscript to rwx using chmod. Then the script will run.
>> >
>> >
>> >
>> > Now that caused another problem. The script passes parameters to a python
>> > program that is still in the project directory not in /tmp…. This causes
>> a
>> > file not found error when the script executes. These temp files remain
>> > after the program exits. I should delete the when the program exits.
>> >
>> >
>> >
>> > What should I do to work around the file not found error?
>> >
>> >
>> >
>> > Marty
>> >
>> >
>> >
>> > From: Jussi Lahtinen [via Gambas] [mailto:ml-node+
>> > [hidden email]]
>> > Sent: Saturday, January 28, 2017 4:36 PM
>> > To: Marty <[hidden email]>
>> > Subject: Re: how-to execute file or bash script packaged inside Gambas
>> >
>> >
>> >
>> > Literally here: /tmp/gambas.1000/3092/1.tmp
>> > Read the error message carefully!
>> >
>> > Paste this into terminal and it will open the folder for you:
>> > nemo /tmp/gambas.1000/3092/
>> >
>> >
>> > Jussi
>> >
>> > On Sat, Jan 28, 2017 at 11:25 PM, Marty <[hidden email]> wrote:
>> >
>> >
>> > > Jussi,
>> > >
>> > >
>> > >
>> > > Thanks for your response. I’ve checked /etc/fstab and There are only
>> two
>> > > partitions the main and swap. I do not see any entry for a tmp
>> partition.
>> > > I’m running Gambas 3.91 under Mint17.1.
>> > >
>> > > Did a routine install when I installed it right from the CD.
>> > >
>> > >
>> > >
>> > > Bennoit,
>> > >
>> > >
>> > >
>> > > Thanks for your suggestion also. All of the files in the project
>> > directory
>> > > have execute permissions set. Where is /tmp/Gambas located? I look at
>> its
>> > > permissions.
>> > >
>> > >
>> > >
>> > > Marty
>> > >
>> > >
>> > >
>> > > From: Jussi Lahtinen [via Gambas] [mailto:ml-node+s8142n58348h5@
>> > > n7.nabble.com]
>> > > Sent: Saturday, January 28, 2017 12:38 PM
>> > > To: Marty <[hidden email]>
>> > > Subject: Re: how-to execute file or bash script packaged inside gambas
>> > >
>> > >
>> > >
>> > > Also does the tmp partition have noexec set (check /etc/fstab)? It's
>> > common
>> > > way to harden Linux installation, but people kind of abuses /tmp...
>> it's
>> > > not for executions.
>> > >
>> > >
>> > > Jussi
>> > >
>> > > On Sat, Jan 28, 2017 at 9:09 PM, Benoît Minisini <
>> > > [hidden email]> wrote:
>> > >
>> > >
>> > > > Le 28/01/2017 à 20:03, Benoît Minisini a écrit :
>> > > > > Le 28/01/2017 à 18:07, Marty a écrit :
>> > > > >> Want to run a script file packaged within the Gambas project.
>> Tried
>> > > the
>> > > > >> method below.
>> > > > >>
>> > > > >> DIM sTempScript as String
>> > > > >>
>> > > > >> sTempScript = Temp$
>> > > > >>
>> > > > >> COPY "update.sh" TO sTempscript
>> > > > >>
>> > > > >> SHELL sTempScript WAIT
>> > > > >>
>> > > > >> Does not work for me. All of the python files are in the gambas
>> > > project
>> > > > >> directory and have execute permissions.
>> > > > >>
>> > > > >> The error is: /bin/sh:1:/tmp/gambas.1000/3092/1.tmp permission
>> > denied
>> > > > >>
>> > > > >> What do I change to allow the python programs to run? Is it the
>> > > project
>> > > > >> directory?
>> > > > >>
>> > > > >> Thanks,
>> > > > >> Marty
>> > > > >>
>> > > > >
>> > > > > Did you set execution rights on the shell file?
>> > > > >
>> > > >
>> > > > I mean on the copy. The permissions on the original file are ignored
>> > > > once you make an executable (they are all read-only and not
>> > executable).
>> > > >
>> > > > --
>> > > > Benoît Minisini
>> > > >
>> > > > ------------------------------------------------------------
>> > > > ------------------
>> > > > Check out the vibrant tech community on one of the world's most
>> > > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> > > > _______________________________________________
>> > > > Gambas-user mailing list
>> > > > [hidden email]
>> > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> > > >
>> > >
>> > > ------------------------------------------------------------
>> > > ------------------
>> > > Check out the vibrant tech community on one of the world's most
>> > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> > > _______________________________________________
>> > > Gambas-user mailing list
>> > > [hidden email]
>> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> > >
>> > >
>> > >
>> > >   _____
>> > >
>> > > If you reply to this email, your message will be added to the
>> discussion
>> > > below:
>> > >
>> > > http://gambas.8142.n7.nabble.com/how-to-execute-file-or-bash
>> > > -script-packaged-inside-gambas-tp20046p58348.html
>> > >
>> > > To start a new topic under gambas-user, email
>> > > [hidden email] <mailto:[hidden email] <mailto:[hidden%20email]> >
>> > > To unsubscribe from how-to execute file or bash script packaged inside
>> > > gambas, click here <http://gambas.8142.n7.nabble.
>> > > com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=
>> > > 20046&code=bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
>> > >  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?
>> macro=macro_
>> > > viewer&id=instant_html%21nabble%3Aemail.naml&base=
>> > > nabble.naml.namespaces.BasicNamespace-nabble.view.web.
>> > > template.NabbleNamespace-nabble.view.web.template.NodeNamesp
>> > > ace&breadcrumbs=notify_subscribers%21nabble%3Aemail.
>> > > naml-instant_emails%21nabble%3Aemail.naml-send_instant_
>> > > email%21nabble%3Aemail.naml> NAML
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > --
>> > > View this message in context: http://gambas.8142.n7.nabble.c
>> > > om/how-to-execute-file-or-bash-script-packaged-inside-gambas
>> > > -tp20046p58349.html
>> > > Sent from the gambas-user mailing list archive at Nabble.com.
>> > > ------------------------------------------------------------
>> > > ------------------
>> > > Check out the vibrant tech community on one of the world's most
>> > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> > > _______________________________________________
>> > > Gambas-user mailing list
>> > > [hidden email]
>> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> > >
>> >
>> > ------------------------------------------------------------
>> > ------------------
>> > Check out the vibrant tech community on one of the world's most
>> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> > _______________________________________________
>> > Gambas-user mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >
>> >
>> >
>> >   _____
>> >
>> > If you reply to this email, your message will be added to the discussion
>> > below:
>> >
>> > http://gambas.8142.n7.nabble.com/how-to-execute-file-or-
>> > bash-script-packaged-inside-gambas-tp20046p58350.html
>> >
>> > To start a new topic under gambas-user, email
>> > [hidden email] <mailto:[hidden email]>
>> > To unsubscribe from how-to execute file or bash script packaged inside
>> > gambas, click here <http://gambas.8142.n7.nabble.
>> > com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=20046&code=
>> > bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
>> >  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?
>> > macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&
>> > base=nabble.naml.namespaces.BasicNamespace-nabble.view.
>> > web.template.NabbleNamespace-nabble.view.web.template.
>> > NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
>> > 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
>> > instant_email%21nabble%3Aemail.naml> NAML
>> >
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context: http://gambas.8142.n7.nabble.
>> > com/how-to-execute-file-or-bash-script-packaged-inside-
>> > gambas-tp20046p58352.html
>> > Sent from the gambas-user mailing list archive at Nabble.com.
>> > ------------------------------------------------------------
>> > ------------------
>> > Check out the vibrant tech community on one of the world's most
>> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> > _______________________________________________
>> > Gambas-user mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> >
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>>
>>
>>   _____
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://gambas.8142.n7.nabble.com/how-to-execute-file-or-
>> bash-script-packaged-inside-gambas-tp20046p58356.html
>>
>> To start a new topic under gambas-user, email
>> [hidden email] <mailto:[hidden email]>
>> To unsubscribe from how-to execute file or bash script packaged inside
>> gambas, click here <http://gambas.8142.n7.nabble.
>> com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=20046&code=
>> bW1jZzI5NDQwQGZyb250aWVyLmNvbXwyMDA0NnwxNDAwMzEwMDQ5> .
>>  <http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?
>> macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&
>> base=nabble.naml.namespaces.BasicNamespace-nabble.view.
>> web.template.NabbleNamespace-nabble.view.web.template.
>> NodeNamespace&breadcrumbs=notify_subscribers%21nabble%
>> 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_
>> instant_email%21nabble%3Aemail.naml> NAML
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://gambas.8142.n7.nabble.
>> com/how-to-execute-file-or-bash-script-packaged-inside-
>> gambas-tp20046p58357.html
>> Sent from the gambas-user mailing list archive at Nabble.com.
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user



--
Fabien Bodard

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Loading...