[Gambas-user] Exec just returns 0 lines when cat cannot read

Benoît Minisini g4mba5 at gmail.com
Mon Nov 16 16:46:01 CET 2020


Le 16/11/2020 à 16:17, PICCORO McKAY Lenz a écrit :
> just reading documenttion :
> 
> Only the standard output of the process is retrieved. The error output 
> is not redirected.
> 
> sorry for noise! i'll use the process sintax
> 
> El lun., 16 de nov. de 2020 a la(s) 11:01, PICCORO McKAY Lenz 
> (mckaygerhard at gmail.com <mailto:mckaygerhard at gmail.com>) escribió:
> 
>     i have this code:
> 
>       rcfilepath =  "/etc/authdaemonrc"
>       If Not Exist(rcfilepath) Then
>              Error "rc file not found "
>              Quit
>       Endif
>     the following line returns no error if file cannot be read:
> 
>       Exec ["cat", rcfilepath] To sLine
> 
>     just offers 0 lines.. using gambas 3.10 and 3.12 .. this is normal?
>     using "cat /path/file" returns error
> 
>     *is there's a way to check if execution was susessfull¡?*
> 

Check the process return value with Process.LastValue and Process.LastState.

Regards,

-- 
Benoît Minisini


More information about the User mailing list