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

T Lee Davidson t.lee.davidson at gmail.com
Tue Nov 17 01:11:50 CET 2020


On 11/16/20 10:01 AM, PICCORO McKAY Lenz wrote:
> 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¡?*
> 
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com <http://qgqlochekone.blogspot.com>
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 

Is there a reason you need to use Exec? If not, try this:
Shell "cat " & rcfilepath & " 2>&1" To sLine


-- 
Lee


More information about the User mailing list