[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to change directory of work?
[Thread Prev] | [Thread Next]
- Subject: Re: how to change directory of work?
- From: Bruce Steers <bsteers4@xxxxxxxxx>
- Date: Mon, 14 Apr 2025 23:18:27 +0100
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Roberto you still sound like you are expecting some kind of workdir happening. Ie a root dir the Gambas application runs commands from. A Gambas application does not have any concept of workdir/current dir like a terminal. You could create a bash/sh process and issue commands to it like cd and it remain live. But like I said, using Shell or Exec will be a fresh process always starting in home unless you use the PWD method suggested. The root dir of your Gambas program cannot be changed. Respects BruceS On Mon, 14 Apr 2025, 12:51 Benoît Minisini, < benoit.minisini@xxxxxxxxxxxxxxxx> wrote: > -------- Message transféré -------- > Sujet : Re: how to change directory of work? > Date : Mon, 14 Apr 2025 01:38:46 +0200 > De : roberto.premoli@xxxxxxxxxx > Pour : Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> > > Il 13.04.2025 23:26 Benoît Minisini ha scritto: > > > Le 13/04/2025 à 23:18, Bruce Steers a écrit : > > > >> On Sun, 13 Apr 2025 at 21:28, > wrote: __ hello. im writing a > >> frontend > >> with gambas to a program (no matter it now), lets call it > >> "executable_cli". This program is in /somewhere/path/to/program, in > >> my > >> case: "/home/user/path/to/program" so i use shell > >> "/home/user/path/to/program" I do what i do into executable_ci, > >> close > >> it and back to frontend. all good till now. But the executable_cli > >> suppose to find and save data in his current directory that is > >> /home/user/path/to/program but frontend current directory is > >> /home/user > >> executable_chi cannot be parametrized with some flag to tell hime > >> where > >> save data and from where retrive data, it supposes always tht place > >> is > >> here it is in the filesystem and I cannot change the executable > >> behaviour. so, from gambas, i try to do: shell "cd > >> /home/user/path/to/program" shell > >> "/home/user/path/to/program/executable_cli" but i does not work exec > >> ["cd /home/user/path/to/program"] does not work either. so, who to > >> tell > >> gambas to "move into" /somewhere/path/to/program? Thanks Roberto > >> there > >> is no such thing as a "working directory" in gambas. every time you > >> run > >> Shell you create a new process so you cannot run "cd dir" in one > >> Shell > >> command then another Shell command be in that dir. You could do it > >> in > >> one single Shell command by using a newline.. Shell "cd > >> /home/user/path/to/programn" & "executable_cli" But you cannot > >> change > >> the applications working directory. BruceS > > > > Otherwise you can actually specify the working directory in Exec or > > Shell by specifying it the "PWD" environment variable. > > > > Exec ["pwd"] With ["PWD=/root"] Wait > > > > It's an undocumented Gambas feature. > > > > Regards, > > > > -- Benoît Minisini. > > > > Hello Mr. Minisini, > i tried this: > > Message(User.home) 'test: it prints "/home/utente" > Exec ["pwd"] With ["PWD=/home/utente/Immagini"] Wait > Message(User.home) 'test: it prints "/home/utente" > > but user.home in not affected. > > Thnks, > Roberto > > > >
Fwd: how to change directory of work? | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |