fopen and open

This is a discussion on fopen and open within the Linux Programming forums, part of the Platform Specific Boards category; what is the difference between the fopen and open functions?...

  1. #1
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493

    fopen and open

    what is the difference between the fopen and open functions?

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >what is the difference between the fopen and open functions?
    A world.

    No, seriously. But the cosmetic differences can be gleaned by looking at the prototypes of each function. The most immediate difference is that fopen returns a FILE * while open returns an int.
    My best code is written with the delete key.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,659
    Also, open() is defined by POSIX and fopen() is ISO-standard C (89/99).

    In some *nix flavors, open() is the interface to the OS. In those systems, fopen() would be implemented by making calls to open().

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fopen can't open .exe?
    By fanoliv in forum C Programming
    Replies: 11
    Last Post: 04-05-2011, 03:24 PM
  2. What are differences between fopen() and open() ?
    By meili100 in forum C++ Programming
    Replies: 9
    Last Post: 04-08-2008, 10:14 AM
  3. open, fopen ?
    By Matrim in forum C Programming
    Replies: 2
    Last Post: 02-01-2005, 08:45 AM
  4. fopen() and open()
    By Encrypted in forum C Programming
    Replies: 8
    Last Post: 02-09-2003, 03:57 PM
  5. fopen vs open
    By rotis23 in forum Linux Programming
    Replies: 5
    Last Post: 12-10-2002, 01:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21