+ Reply to Thread
Results 1 to 2 of 2

Thread: What is the differnce in fopen and CreateFile on Window?

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    23

    What is the differnce in fopen and CreateFile on Window?

    Out of these two APIs, which API should I use in my application and which is recommended?

    Are they same?

    Please clear my doubts on this.

  2. #2
    Junior Member
    Join Date
    Feb 2012
    Posts
    29
    a. fopen

    This is available to you to make your application cross platform.

    Internally, this API will make use of CreateFile WIN32 API!

    b. CreateFile

    This is much robust and useful than fopen CRT function.

    You can specify:
    a. security objects
    b. Optimization flags are available
    c. you can have asynchronous FILE IO handling
    d. You can save one indirect function call!

    So, if you are building application for Windows then you should consider using CreateFile API.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts