<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- permission is obtained from the copyright holder. -->
|
<!-- permission is obtained from the copyright holder. -->
|
<HTML
|
<HTML
|
><HEAD
|
><HEAD
|
><TITLE
|
><TITLE
|
>Files and Directories [POSIX Section 5]</TITLE
|
>Files and Directories [POSIX Section 5]</TITLE
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
<META
|
<META
|
NAME="GENERATOR"
|
NAME="GENERATOR"
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
"><LINK
|
"><LINK
|
REL="HOME"
|
REL="HOME"
|
TITLE="eCos Reference Manual"
|
TITLE="eCos Reference Manual"
|
HREF="ecos-ref.html"><LINK
|
HREF="ecos-ref.html"><LINK
|
REL="UP"
|
REL="UP"
|
TITLE="POSIX Standard Support"
|
TITLE="POSIX Standard Support"
|
HREF="posix-standard-support.html"><LINK
|
HREF="posix-standard-support.html"><LINK
|
REL="PREVIOUS"
|
REL="PREVIOUS"
|
TITLE="Process Environment [POSIX Section 4]"
|
TITLE="Process Environment [POSIX Section 4]"
|
HREF="posix-process-environment.html"><LINK
|
HREF="posix-process-environment.html"><LINK
|
REL="NEXT"
|
REL="NEXT"
|
TITLE="Input and Output [POSIX Section 6]"
|
TITLE="Input and Output [POSIX Section 6]"
|
HREF="posix-input-and-output.html"></HEAD
|
HREF="posix-input-and-output.html"></HEAD
|
><BODY
|
><BODY
|
CLASS="SECT1"
|
CLASS="SECT1"
|
BGCOLOR="#FFFFFF"
|
BGCOLOR="#FFFFFF"
|
TEXT="#000000"
|
TEXT="#000000"
|
LINK="#0000FF"
|
LINK="#0000FF"
|
VLINK="#840084"
|
VLINK="#840084"
|
ALINK="#0000FF"
|
ALINK="#0000FF"
|
><DIV
|
><DIV
|
CLASS="NAVHEADER"
|
CLASS="NAVHEADER"
|
><TABLE
|
><TABLE
|
SUMMARY="Header navigation table"
|
SUMMARY="Header navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TH
|
><TH
|
COLSPAN="3"
|
COLSPAN="3"
|
ALIGN="center"
|
ALIGN="center"
|
>eCos Reference Manual</TH
|
>eCos Reference Manual</TH
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="posix-process-environment.html"
|
HREF="posix-process-environment.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="80%"
|
WIDTH="80%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
>Chapter 31. POSIX Standard Support</TD
|
>Chapter 31. POSIX Standard Support</TD
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="posix-input-and-output.html"
|
HREF="posix-input-and-output.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"></DIV
|
WIDTH="100%"></DIV
|
><DIV
|
><DIV
|
CLASS="SECT1"
|
CLASS="SECT1"
|
><H1
|
><H1
|
CLASS="SECT1"
|
CLASS="SECT1"
|
><A
|
><A
|
NAME="POSIX-FILES-AND-DIRECTORIES">Files and Directories [POSIX Section 5]</H1
|
NAME="POSIX-FILES-AND-DIRECTORIES">Files and Directories [POSIX Section 5]</H1
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="AEN13039">Functions Implemented</H2
|
NAME="AEN13039">Functions Implemented</H2
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="SCREEN"
|
CLASS="SCREEN"
|
>DIR *opendir( const char *dirname );
|
>DIR *opendir( const char *dirname );
|
struct dirent *readdir( DIR *dirp );
|
struct dirent *readdir( DIR *dirp );
|
int readdir_r( DIR *dirp, struct dirent *entry,
|
int readdir_r( DIR *dirp, struct dirent *entry,
|
struct dirent **result );
|
struct dirent **result );
|
void rewinddir( DIR *dirp );
|
void rewinddir( DIR *dirp );
|
int closedir( DIR *dirp );
|
int closedir( DIR *dirp );
|
int chdir( const char *path );
|
int chdir( const char *path );
|
char *getcwd( char *buf, size_t size );
|
char *getcwd( char *buf, size_t size );
|
int open( const char * path , int oflag , ... );
|
int open( const char * path , int oflag , ... );
|
int creat( const char * path, mode_t mode );
|
int creat( const char * path, mode_t mode );
|
int link( const char *existing, const char *new );
|
int link( const char *existing, const char *new );
|
int mkdir( const char *path, mode_t mode );
|
int mkdir( const char *path, mode_t mode );
|
int unlink( const char *path );
|
int unlink( const char *path );
|
int rmdir( const char *path );
|
int rmdir( const char *path );
|
int rename( const char *old, const char *new );
|
int rename( const char *old, const char *new );
|
int stat( const char *path, struct stat *buf );
|
int stat( const char *path, struct stat *buf );
|
int fstat( int fd, struct stat *buf );
|
int fstat( int fd, struct stat *buf );
|
int access( const char *path, int amode );
|
int access( const char *path, int amode );
|
long pathconf(const char *path, int name);
|
long pathconf(const char *path, int name);
|
long fpathconf(int fd, int name);</PRE
|
long fpathconf(int fd, int name);</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="AEN13042">Functions Omitted</H2
|
NAME="AEN13042">Functions Omitted</H2
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="SCREEN"
|
CLASS="SCREEN"
|
>mode_t umask( mode_t cmask );
|
>mode_t umask( mode_t cmask );
|
int mkfifo( const char *path, mode_t mode );
|
int mkfifo( const char *path, mode_t mode );
|
int chmod( const char *path, mode_t mode ); // TBA
|
int chmod( const char *path, mode_t mode ); // TBA
|
int fchmod( int fd, mode_t mode ); // TBA
|
int fchmod( int fd, mode_t mode ); // TBA
|
int chown( const char *path, uid_t owner, gid_t group );
|
int chown( const char *path, uid_t owner, gid_t group );
|
int utime( const char *path, const struct utimbuf *times ); // TBA
|
int utime( const char *path, const struct utimbuf *times ); // TBA
|
int ftruncate( int fd, off_t length ); // TBA</PRE
|
int ftruncate( int fd, off_t length ); // TBA</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="AEN13045">Notes</H2
|
NAME="AEN13045">Notes</H2
|
><P
|
><P
|
></P
|
></P
|
><UL
|
><UL
|
><LI
|
><LI
|
><P
|
><P
|
> If a call to <TT
|
> If a call to <TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>open()</TT
|
>open()</TT
|
> or <TT
|
> or <TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>creat()</TT
|
>creat()</TT
|
> supplies
|
> supplies
|
the third _mode_ parameter, it will
|
the third _mode_ parameter, it will
|
currently be ignored.
|
currently be ignored.
|
</P
|
</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
> Most of the functionality of these functions depends on
|
> Most of the functionality of these functions depends on
|
the underlying filesystem.
|
the underlying filesystem.
|
</P
|
</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
> Currently<SPAN
|
> Currently<SPAN
|
CLASS="emphasis"
|
CLASS="emphasis"
|
><I
|
><I
|
CLASS="EMPHASIS"
|
CLASS="EMPHASIS"
|
> access()</I
|
> access()</I
|
></SPAN
|
></SPAN
|
> only checks the
|
> only checks the
|
<SPAN
|
<SPAN
|
CLASS="emphasis"
|
CLASS="emphasis"
|
><I
|
><I
|
CLASS="EMPHASIS"
|
CLASS="EMPHASIS"
|
>F_OK</I
|
>F_OK</I
|
></SPAN
|
></SPAN
|
> mode explicitly, the others are
|
> mode explicitly, the others are
|
all assumed to be true by default.
|
all assumed to be true by default.
|
</P
|
</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
> The maximum number of open files allowed is supplied by
|
> The maximum number of open files allowed is supplied by
|
the CYGNUM_FILEIO_NFILE option. The maximum number
|
the CYGNUM_FILEIO_NFILE option. The maximum number
|
of file descriptors is supplied by the CYGNUM_FILEIO_NFD
|
of file descriptors is supplied by the CYGNUM_FILEIO_NFD
|
option.
|
option.
|
</P
|
</P
|
></LI
|
></LI
|
></UL
|
></UL
|
></DIV
|
></DIV
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NAVFOOTER"
|
CLASS="NAVFOOTER"
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"><TABLE
|
WIDTH="100%"><TABLE
|
SUMMARY="Footer navigation table"
|
SUMMARY="Footer navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="posix-process-environment.html"
|
HREF="posix-process-environment.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="ecos-ref.html"
|
HREF="ecos-ref.html"
|
ACCESSKEY="H"
|
ACCESSKEY="H"
|
>Home</A
|
>Home</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="posix-input-and-output.html"
|
HREF="posix-input-and-output.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
>Process Environment [POSIX Section 4]</TD
|
>Process Environment [POSIX Section 4]</TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="posix-standard-support.html"
|
HREF="posix-standard-support.html"
|
ACCESSKEY="U"
|
ACCESSKEY="U"
|
>Up</A
|
>Up</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
>Input and Output [POSIX Section 6]</TD
|
>Input and Output [POSIX Section 6]</TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
></BODY
|
></BODY
|
></HTML
|
></HTML
|
|
|