Author: codetoad | Posted on: 8/7/2008 2:12:41 AM | Views : 314

I have a code which creates one binary file and with every user interaction inserts some records in the file, each record in one line, What i do is check whether the file exists in the particular folder or not , if the file does not exists then the program creates a file and add a record in the file based on the user request, but if the file exists in the folder ,then the code appends the record in the existing file in a new line, just after the last record.

I need to keep the first line of the file as the counter, which displays the total number of records in the file,so i need to update the counter everytime a user clicks on any item on the site, the problem is that when the counter is update for the first time , the position of the first record is changed the first record shifts from the second line to the first line just after the counter, following is the code........

In the code i have used a static value "ab" ...

Go to the complete details ...