Annotation of libwww/Library/src/HTLocal.html, revision 2.1
2.1 ! frystyk 1: <HTML>
! 2: <HEAD>
! 3: <TITLE>W3C Reference Library libwww Local File Access</TITLE>
! 4: <!-- Changed by: Henrik Frystyk Nielsen, 3-Apr-1996 -->
! 5: </HEAD>
! 6: <BODY>
! 7:
! 8: <H1>Locsl File Access</H1>
! 9:
! 10: <PRE>
! 11: /*
! 12: ** (c) COPYRIGHT MIT 1995.
! 13: ** Please first read the full copyright statement in the file COPYRIGH.
! 14: */
! 15: </PRE>
! 16:
! 17: This module has the common code for opening and closing local files.<P>
! 18:
! 19: This module is implemented by <A HREF="HTTCP.c">HTTCP.c</A>, and it is
! 20: a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C
! 21: Reference Library</A>.
! 22:
! 23: <PRE>
! 24: #ifndef HTLOCAL_H
! 25: #define HTLOCAL_H
! 26:
! 27: #include "HTNet.h"
! 28: </PRE>
! 29:
! 30: <H2>Mode of File</H2>
! 31:
! 32: A file can be opened in variuos modes dependent on whether it is to be
! 33: opened for reading or writing or both. We here define a set that is
! 34: largely equivalent to what we know from ANSI C file modes and Unix
! 35: file modes:
! 36:
! 37: <PRE>
! 38: #ifndef NO_UNIX_IO
! 39: typedef int HTLocalMode;
! 40:
! 41: #define HT_FB_RDONLY O_RDONLY
! 42: #define HT_FT_RDONLY HT_FB_RDONLY
! 43:
! 44: #define HT_FB_WRONLY O_WRONLY|O_CREAT
! 45: #define HT_FT_WRONLY HT_FB_WRONLY
! 46:
! 47: #define HT_FB_RDWR O_RDWR
! 48: #define HT_FT_RDWR HT_FB_RDWR
! 49:
! 50: #define HT_FB_APPEND O_APPEND
! 51: #define HT_FT_APPEND HT_FB_APPEND
! 52:
! 53: #else
! 54: typedef const char HTLocalMode[10];
! 55:
! 56: #define HT_FB_RDONLY "rb"
! 57: #define HT_FT_RDONLY "r"
! 58:
! 59: #define HT_FB_WRONLY "wb"
! 60: #define HT_FT_WRONLY "w"
! 61:
! 62: #define HT_FB_RDWR "r+b"
! 63: #define HT_FT_RDWR "r+"
! 64:
! 65: #define HT_FB_APPEND "ab"
! 66: #define HT_FT_APPEND "a"
! 67:
! 68: #endif
! 69: </PRE>
! 70:
! 71: <H2>Open a Local File</H2>
! 72:
! 73: Opens a local file using whatever means are available on the current
! 74: platform. If we have unix file descriptors then use that as we can use
! 75: select on them. On windows we want to use asynchrounous handles - just
! 76: like we handle the socket interface as well. On other platforms, we
! 77: use ANSI C file descriptors.
! 78:
! 79: <PRE>
! 80: extern int HTFileOpen (HTNet * net, char * local, HTLocalMode mode);
! 81: </PRE>
! 82:
! 83: <H2>Close a Local File</H2>
! 84:
! 85: Closes a file descriptor whatever means are available on the current
! 86: platform. If we have unix file descriptors then use this otherwise use
! 87: the ANSI C file descriptors
! 88:
! 89: <PRE>
! 90: extern int HTFileCLose (HTNet * net);
! 91: </PRE>
! 92:
! 93:
! 94: <PRE>
! 95: #endif /* HTLOCAL_H */
! 96: </PRE>
! 97:
! 98: <HR>
! 99: <ADDRESS>
! 100: @(#) $Id: Date Author State $
! 101: </ADDRESS>
! 102: </BODY>
! 103: </HTML>
Webmaster