The Open Source Swiss Army Knife

/code/c/unix_c/filedes/
/code/c/unix_c/filedes/ + sub-categories
http://www.sirfsup.com/
web directory content
    
      

Not logged in
Chat Register Login
return to:  http:/www.sirfsup.com      /code   /c   /unix_c   /filedes 
Permalink: open.htm
Title: describes open()
article options : please login   |  print view

linux programming in C

  • open() int open(const char *pathname, int flags)
    int open(const char *pathname, int flags, mode_t mode)
    see the man page
    • pathname: a string with the full or relative pathname of the file
    • O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL, O_NOCTTY....
    • third option: the permission bits to be used for that file creation ONLY

    example

    #include 
    #include 
    #include 
    /* open.c */
    int open(const char * pathname, int flags).
    int open(const char *pathname, int flags, mode_t mode);
    STDOUT: 
    open.c.8:warning: extern declaration of 'open' doesn't match global one
    

Leave a Reply
Your Name:     anonymous
Your Email:
Website:  
Comments:

The author will be notified of your reply.
return to top