<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE>
BLOCKQUOTE {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
LINE-HEIGHT: 1.5; FONT-FAMILY: ΢ÈíÑźÚ; COLOR: #000000; FONT-SIZE: 10.5pt
}
</STYLE>
<META name=GENERATOR content="MSHTML 9.00.8112.16441"></HEAD>
<BODY style="MARGIN: 10px">
<DIV>There is some problem that using a pipe for input stream of x264.exe on
Window Platform, I think the problem is the two functions I
mention.</DIV>
<DIV>I think it's check the return value in wrong way.</DIV>
<DIV> </DIV>
<DIV>In the function mention in the topic, I found the code below:</DIV>
<DIV> </DIV>
<DIV>
<DIV> if( fstat( fileno( filehandle ), &file_stat ) )</DIV>
<DIV> return -1;</DIV></DIV>
<DIV> </DIV>
<DIV>
<DIV> if( stat( filename, &file_stat ) )</DIV>
<DIV> return -1;</DIV></DIV>
<DIV> </DIV>
<DIV>but when I check for fstat & stat in MSDN and Linux man page
@linux.die.net , I found the return value is defined below:</DIV>
<DIV>fstat - Linux man page(link: <A
href="http://linux.die.net/man/2/fstat">http://linux.die.net/man/2/fstat</A>)</DIV>
<DIV> </DIV>
<DIV>
<H2>Return Value</H2>
<P>On success, zero is returned. On error, -1 is returned, and <I>errno</I> is
set appropriately. </P>
<P> </P>
<P>stat - Linux man page(link: <A
href="http://linux.die.net/man/2/stat">http://linux.die.net/man/2/stat</A>)</P>
<P> </P>
<H2>Return Value</H2>
<P>On success, zero is returned. On error, -1 is returned, and <I>errno</I> is
set appropriately. </P>
<P> </P>
<P>and also in MSDN Library.</P>
<P> </P>
<P>fstat :</P>
<P> </P></DIV>
<DIV>Return Value
<DIV id=returnValueSection class=section name="collapseableSection">
<P>Returns 0 if the file-status information is obtained. A return value of ¨C1
indicates an error. If the file descriptor is invalid or <SPAN class=parameter
sdata="paramReference">buffer</SPAN> is <SPAN sdata="langKeyword"
value="NULL"><SPAN class=keyword>NULL</SPAN></SPAN>, the invalid parameter
handler is invoked, as described in <SPAN sdata="link"><A
href="ms-help://MS.MSDNQTR.v90.chs/dv_vccrt/html/019dd5f0-dc61-4d2e-b4e9-b66409ddf1f2.htm">Parameter
Validation</A></SPAN>. If execution is allowed to continue, <SPAN
sdata="langKeyword" value="errno"><SPAN class=keyword>errno</SPAN></SPAN> is set
to <SPAN sdata="langKeyword" value="EBADF"><SPAN
class=keyword>EBADF</SPAN></SPAN>, in the case of an invalid file descriptor, or
to <SPAN sdata="langKeyword" value="EINVAL"><SPAN
class=keyword>EINVAL</SPAN></SPAN>, if <SPAN class=parameter
sdata="paramReference">buffer</SPAN> is <SPAN sdata="langKeyword"
value="NULL"><SPAN class=keyword>NULL</SPAN></SPAN>. </P>
<P> </P>
<P>stat :</P>
<P> </P>
<DIV>Return Value</DIV>
<DIV>Each of these functions returns 0 if the file-status information is obtained. A return value of ¨C1 indicates an error, in which case errno is set to ENOENT, indicating that the filename or path could not be found. A return value of EINVAL indicates an invalid parameter; errno is also set to EINVAL in this case. </DIV>
<DIV> </DIV>
<DIV>SORRY FOR MY POOR ENGLISH.</DIV></DIV></DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>
<DIV><SPAN>zxfishhack</SPAN></DIV></BODY></HTML>