CFanatic

Go Back   CFanatic > Advance Programming > Network Programming

Join CFanatic Forum Now

fprintf to a network file topic posted under Network Programming which is a part of Advance Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 07-07-2010, 02:25 AM
Junior Member
 
Join Date: Jul 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
wf_798088 is on a distinguished road
| More
fprintf to a network file

on windows 2008 server,when I use fprintf to write a LAN network share file frequently,sometimes the file pointer jump back:

fp = fopen(filename,"a+");

...

while()
{

...
pos1 = ftell(fp); <====== pos1 == 1000
fprintf(fp,"%s\n",str);
pos2 = ftell(fp); <====== pos2 == 800
...

fflush(fp);
}


At the same time, the file contents will be disordered.
The latter record will overrite the previous record.



please help to explain it, thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Certain characters read from file and save in new file meyup C Programming 5 06-12-2010 07:27 PM
File I/O (Reading from a Random-Access File) VersEtreOuNe C++ Programming 0 02-12-2008 03:39 PM
read file n spot blank char n re write file witout extra blank dev1910 C++ Programming 1 12-17-2007 12:43 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 01:56 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board