Connecting Tech Pros Worldwide Help | Site Map

end of file problem

xyz
Guest
 
Posts: n/a
#1: Jul 21 '08
hi all,
i have a small question !! for example
ifstream filein(par("fileName"));

i have 3 clients taking three different input files which are of
different sizes. My 3 clients share the same function to open the file
and reading line by line..

my problem is i need to finish my simulation after reading whole 3
files completely and terminaate the simulation.

if i write filein.eof() function...then at that time if the event is
at client 1....if checks if it is end of file in client 1's text file
then the simulation is terminated....i am loosing remaining lines in
client 2 and client 3's input files...

how to resolve this issue
thanks to all
puzzlecracker
Guest
 
Posts: n/a
#2: Jul 21 '08

re: end of file problem


On Jul 21, 9:27*am, xyz <lavanyaredd...@gmail.comwrote:
Quote:
hi all,
i have a small question !! for example
ifstream filein(par("fileName"));
>
i have 3 clients taking three different input files which are of
different sizes. My 3 clients share the same function to open the file
and reading line by line..
>
my problem is i need to finish my simulation after reading whole 3
files completely and terminaate the simulation.
>
if i write filein.eof() function...then at that time if the event is
at client 1....if checks if it is end of file in client 1's text file
then the simulation is terminated....i am loosing remaining lines in
client 2 and client 3's input files...
>
how to resolve this issue
thanks to all
use mutex (say pthreads), sync clients.
Closed Thread


Similar C / C++ bytes