Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2020-07

TProcess.CurrentDirectory doc

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexey Tor.

https://lazarus-ccr.sourceforge.io/docs/fcl/process/tprocess.currentdirectory.html

CurrentDirectory specifies the working directory of the newly started process.Changing this property after the process was started has no effect.

need more info there! a) what happens when the process, eg Bash file, changes its working dir (via "cd") many times and I read CurrentDirectory eg during OnReadData (ASyncProcess)? do I get changed cur-dir, or initial dir? b) do i get changed dir on all OSes? c) if Bash file runs child bash file which changes cur-dir, do i get changed dir?

Alexey Torgashin

Reply by email

Sven Barth
to Alexey Tor.
Alexey Tor. wrote 14 lines
https://lazarus-ccr.sourceforge.io/docs/fcl/process/tprocess.currentdirectory.html CurrentDirectory specifies the working directory of the newly started process.Changing this property after the process was started has no effect. need more info there! a) what happens when the process, eg Bash file, changes its working dir (via "cd") many times and I read CurrentDirectory eg during OnReadData (ASyncProcess)? do I get changed cur-dir, or initial dir? b) do i get changed dir on all OSes? c) if Bash file runs child bash file which changes cur-dir, do i get changed dir?

Please report on Mantis.

Regards,
Sven

Reply by email

Michael Van Canneyt
to Sven Barth
Sven Barth wrote 6 lines
Am 06.07.2020 um 23:31 schrieb Alexey Tor. via fpc-pascal: > > https://lazarus-ccr.sourceforge.io/docs/fcl/process/tprocess.currentdirectory.html > > CurrentDirectory specifies the working directory of the newly started > process.Changing this property after the process was started has no effect.

I added 'initial' to working directory.

Show quoted text 6 lines
> > need more info there! a) what happens when the process, eg Bash file, > changes its working dir (via "cd") many times and I read CurrentDirectory > eg during OnReadData (ASyncProcess)? do I get changed cur-dir, or initial > dir? b) do i get changed dir on all OSes? c) if Bash file runs child bash > file which changes cur-dir, do i get changed dir?

No, because it is the *initial* directory only.

I changed the docs, no need to submit a report.

Michael.

Reply by email

Sven Barth
to Michael Van Canneyt

Michael Van Canneyt schrieb am Di., 7. Juli 2020, 07:44:

Show quoted text 29 lines
On Tue, 7 Jul 2020, Sven Barth via fpc-pascal wrote: > Am 06.07.2020 um 23:31 schrieb Alexey Tor. via fpc-pascal: >> >> https://lazarus-ccr.sourceforge.io/docs/fcl/process/tprocess.currentdirectory.html >> >> CurrentDirectory specifies the working directory of the newly started >> process.Changing this property after the process was started has no effect. I added 'initial' to working directory. >> >> need more info there! a) what happens when the process, eg Bash file, >> changes its working dir (via "cd") many times and I read CurrentDirectory >> eg during OnReadData (ASyncProcess)? do I get changed cur-dir, or initial >> dir? b) do i get changed dir on all OSes? c) if Bash file runs child bash >> file which changes cur-dir, do i get changed dir? No, because it is the *initial* directory only. I changed the docs, no need to submit a report.

Even better :D

Regards,
Sven

Reply by email

Marco van de Voort
to Michael Van Canneyt: I added 'initial' to working directory. No, because it is the *initial* directory only. I…

Op 07/07/2020 om 07:44 schreef Michael Van Canneyt:

Show quoted text 11 lines
>> need more info there! a) what happens when the process, eg Bash >> file, changes its working dir (via "cd") many times and I read >> CurrentDirectory eg during OnReadData (ASyncProcess)? do I get >> changed cur-dir, or initial dir? b) do i get changed dir on all >> OSes? c) if Bash file runs child bash file which changes cur-dir, do >> i get changed dir? No, because it is the *initial* directory only. I changed the docs, no need to submit a report.

I quickly walked through the tprocess docs and most new things in 3.2.0 are nicely documented, nice!  Just two emergency changes from May aren't, and might need rerunning makeskel for it.

See two identifiers without description in
https://www.freepascal.org/docs-html/current/fcl/process/tprocessoptions.html

porunidle:  Run  Runidle event.  By default this is a sleep (to avoid busy waiting with long living processes)

podetached: Windows specific alternative to poNoConsole.   Still creates a console handle even if it doesn't show it.
(https://forum.lazarus.freepascal.org/index.php/topic,49631.0)

Reply by email