fread readfile

This is a discussion on fread readfile within the Windows Programming forums, part of the Platform Specific Boards category; can fread do everything that readfile does almost? howabout bitmaps if i use binary flags?. havent tried it with bitmaps ...

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    20

    fread readfile

    can fread do everything that readfile does almost?

    howabout bitmaps if i use binary flags?. havent tried it with bitmaps yet.

    if yes wont bother with readfile anymore.

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    I've never used readfile(), but you can use fread() to manage all kinds of file data. Text & binary (includes documents, bitmaps, XXX [insert filetype here] ).
    I prefer fstream (C++) myself, but that's my taste .
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User SAMSAM's Avatar
    Join Date
    Nov 2001
    Posts
    218
    thx magos i usualy use fread for structure sized built files of my own ie"random access" but can it be used for sequentials as well/

    like for example i have afile that adds a date to my file sequencially everytime i open the program itself.


    adds automaticaly the date to file date.dat with the use of GetTimeDateFormat function upon openting the window without any users input .

    like as follow;

    open program------------>adds date format to file date-->jan 20 03
    open program------------>adds date format to file date-->jan 21 03


    and so on.

    but then should i be using SEEK_CUR in fseek function or continue with regular SEEK_SET?

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    You need to open it as "Append":

    fopen("MyFile.dat", "a");

    Not sure whether you need to set the position at the end manually or if that happens automagically...
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fread problems or memory problems
    By Lechuza in forum C Programming
    Replies: 1
    Last Post: 03-22-2009, 01:45 PM
  2. Another link from Microsoft about bug in fread
    By vart in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 05-06-2008, 12:56 PM
  3. How to load pixels of BMP into an array
    By brconner in forum Windows Programming
    Replies: 10
    Last Post: 06-02-2007, 05:30 AM
  4. Why is fread sometimes taking so long?
    By manugarciac in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2007, 12:25 AM
  5. fread item_size limit
    By nvoigt in forum C++ Programming
    Replies: 2
    Last Post: 03-30-2005, 09:08 AM

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