I am out of idea what to do to resolve the problem!
I need to use the open(file, for.., access) function to write a file.
Never have the situation like that: it is return 0 - zero.
As a result all write(..) going to the screen!
What the problem it could be?
I do not even know what to show in code.
Opened this way:
Code:
if (fdRPT = open( rpt_fl, O_WRONLY|O_CREAT|O_TRUNC, 0666) == -1 )
{ .../*error*/ ;}
The 'rpt_fl' is fine
Code:
...
printf ("\n -- The report file is: >%s< -- \n",rpt_fl);
....
prints out:
Code:
-- The report file is: >DATA/elm0653M.rpt.0008< --
and
Code:
> ll DATA/elm0653M.rpt.0008
-rw-rw-rw- 1 dca0701 dstnse 0 Mar 8 13:06 DATA/elm0653M.rpt.0008
I undestand that the system by default should have the '0' descriptor associated with the standart output and have it unavailable (or already assighned) on any, even first a file descriptor request (by the open(..),) but it is not happening in my case.
I am stucked with how get it resolve.
What could be the reason for such behavior?
What would you advise to do to realise the problem or correct it?
I am appreciate any help and every try!