stat.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <html>
  2. <head>
  3. <title>stat</title>
  4. <body bgcolor=#ffffff>
  5. <h2 align=center>stat</h2>
  6. <h4 align=center>OS/161 Reference Manual</h4>
  7. <h3>Name</h3>
  8. stat - get file state information
  9. <h3>Library</h3>
  10. Standard C Library (libc, -lc)
  11. <h3>Synopsis</h3>
  12. #include &lt;sys/stat.h&gt;<br>
  13. <br>
  14. int<br>
  15. stat(const char *<em>pathname</em>, struct stat *<em>statbuf</em>);
  16. <h3>Description</h3>
  17. stat retrieves status information about the file referred to by
  18. <em>pathname</em> and stores it in the stat structure pointed to
  19. by <em>statbuf</em>.
  20. <h3>Return Values</h3>
  21. On success, stat returns 0. On error, -1 is returned, and
  22. <A HREF=errno.html>errno</A> is set according to the error
  23. encountered.
  24. <h3>Errors</h3>
  25. The following error codes should be returned under the conditions
  26. given. Other error codes may be returned for other errors not
  27. mentioned here.
  28. <blockquote><table width=90%>
  29. <td width=10%>&nbsp;</td><td>&nbsp;</td></tr>
  30. <tr><td>ENODEV</td> <td>The device prefix of <em>filename</em> did
  31. not exist.</td></tr>
  32. <tr><td>ENOTDIR</td> <td>A non-final component of <em>pathname</em>
  33. was not a directory.</td></tr>
  34. <tr><td>ENOENT</td> <td>The named file does not exist.</td></tr>
  35. <tr><td>EIO</td> <td>A hard I/O error occurred.</td></tr>
  36. <tr><td>EFAULT</td> <td><em>statbuf</em> points to an invalid
  37. address.</td></tr>
  38. </table></blockquote>
  39. </body>
  40. </html>