Thread: Writing/Reading multiple files...??

  1. #1
    Ugly C Lover audinue's Avatar
    Join Date
    Jun 2008
    Location
    Indonesia
    Posts
    489

    Exclamation Writing/Reading multiple files...??

    I wonder, is it safe to write/read multiple files in the same time (using thread)?

    Could it damage the disk?

    I'm a little bit scary here...

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    You should be OK. There is no rule against having ore than one file open at a time, and if different threads are reading/writing different files I wouldn't anticipate any trouble.

    ...Of course, there is always the possibility of something going terribly wrong during development. I wouldn't worry about physically "damaging" the disk... But you could accidently over-write some data, or something like that.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    No, it will not damage your hard drive.
    However, as DougDbug mentions, there are multi-threaded issues around this, so be sure to lock before reading and writing when multiple threads share the same file.
    There's a possibility you can corrupt your own files, due to multi-threaded issues.
    Last edited by Elysia; 07-28-2008 at 04:09 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Ugly C Lover audinue's Avatar
    Join Date
    Jun 2008
    Location
    Indonesia
    Posts
    489
    Thank you very much guys ...(~^_^~)!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. need assistance with multiple files
    By c++.prog.newbie in forum C++ Programming
    Replies: 7
    Last Post: 03-21-2006, 01:44 AM
  2. Windows shell commands - multiple files
    By Magos in forum Tech Board
    Replies: 3
    Last Post: 02-28-2006, 01:56 AM
  3. Linker errors - Multiple Source files
    By nkhambal in forum C Programming
    Replies: 3
    Last Post: 04-24-2005, 02:41 AM
  4. copy multiple files to a destination file
    By Bones in forum C++ Programming
    Replies: 2
    Last Post: 10-02-2003, 10:47 AM
  5. opening multiple files sequentially
    By moonwalker in forum C Programming
    Replies: 5
    Last Post: 08-20-2002, 09:57 PM