remove.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <html>
  2. <head>
  3. <title>remove</title>
  4. <body bgcolor=#ffffff>
  5. <h2 align=center>remove</h2>
  6. <h4 align=center>OS/161 Reference Manual</h4>
  7. <h3>Name</h3>
  8. remove - delete (unlink) a file
  9. <h3>Library</h3>
  10. Standard C Library (libc, -lc)
  11. <h3>Synopsis</h3>
  12. #include &lt;unistd.h&gt;<br>
  13. <br>
  14. int<br>
  15. remove(const char *<em>pathname</em>);
  16. <h3>Description</h3>
  17. The name of the file referred to by <em>pathname</em> is removed from
  18. the filesystem. The actual file itself is not removed until no further
  19. references to it exist, whether those references are on disk or in
  20. memory.
  21. <p>
  22. It is an error for <em>pathname</em> to not specify an existing file
  23. or to refer to a directory.
  24. <p>
  25. <h3>Return Values</h3>
  26. On success, remove returns 0. On error, -1 is returned, and
  27. <A HREF=errno.html>errno</A> is set according to the error
  28. encountered.
  29. <h3>Errors</h3>
  30. The following error codes should be returned under the conditions
  31. given. Other error codes may be returned for other errors not
  32. mentioned here.
  33. <blockquote><table width=90%>
  34. <td width=10%>&nbsp;</td><td>&nbsp;</td></tr>
  35. <tr><td>ENODEV</td> <td>The device prefix of <em>filename</em> did
  36. not exist.</td></tr>
  37. <tr><td>ENOTDIR</td> <td>A non-final component of <em>pathname</em>
  38. was not a directory.</td></tr>
  39. <tr><td>EISDIR</td> <td><em>pathname</em> referred to a directory.</td></tr>
  40. <tr><td>ENOENT</td> <td>The target file did not exist.</td></tr>
  41. <tr><td>EIO</td> <td>A hard I/O error occurred.</td></tr>
  42. <tr><td>EFAULT</td> <td><em>pathname</em> was an invalid pointer.</td></tr>
  43. </table></blockquote>
  44. </body>
  45. </html>