Thread: file handling/comparing.

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    17

    file handling/comparing.

    hi All!

    i need to do the follwoing i will create a thread
    which will contineously read data from serial port and
    will dump it in a file. Second thread will contineously read this data
    and compare it with the previous data in the same file if there
    is any change it will set some flag.Basically i don't know much
    about file handling, could somebody suggest as how to do it?

    thanks
    cool

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    329
    You can use the _fstat function to see if the file is changed.
    For file IO, the easiest would be to use fopen/fread/fwrite, etc..(Alternatively open/sopen/read/write)
    For syncronization between the threads you can use CreateMutex/WaitforsingleObject/ReleaseMutex

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  2. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  3. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  4. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM