| View previous topic :: View next topic |
| Author |
Message |
Bizarro I post too much
Reputation: 0
Joined: 01 May 2007 Posts: 2648
|
Posted: Fri Aug 22, 2008 5:21 am Post subject: [fstream] write in file |
|
|
i was wondering if a file is currently being used/loaded,
can i still use fstream to write on it(ie insert more bytes or replaces some bytes)?
_________________
w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils |
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Fri Aug 22, 2008 6:05 am Post subject: |
|
|
| You'll have to close it first.
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Fri Aug 22, 2008 8:07 am Post subject: |
|
|
| Symbol wrote: | | You'll have to close it first. |
No. You can open up many fstreams of the same file, writing to it at which ever time you want.
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Fri Aug 22, 2008 8:19 am Post subject: |
|
|
Don't you have to close it first? how come you don't get access denied?
Edit:
| Quote: | | After all necessary operations on a file have been performed, it can be closed (or disassociated) by calling member close. Once closed, the same file stream object may be used to open another file. |
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Fri Aug 22, 2008 11:07 am Post subject: |
|
|
| Symbol wrote: | Don't you have to close it first? how come you don't get access denied?
Edit:
| Quote: | | After all necessary operations on a file have been performed, it can be closed (or disassociated) by calling member close. Once closed, the same file stream object may be used to open another file. |
|
the same file stream it is talking about is the "variable" that contains the file handle. you can only open one file in each "variable" (fstream).
That is what the statement says.
|
|
| Back to top |
|
 |
|