Forum Moderators: coopster

Message Too Old, No Replies

simple data retrieved from txt file?

         

dulldull

9:07 pm on Aug 17, 2009 (gmt 0)

10+ Year Member



Hi,

I'd like to build a simple cronjob programme that will submit one of a batch of X-Y coordinates into a remote form through CURL.

The x-y coordinate looks like this:
(1012, 1993), (394, 1329), (2323, 191) ... and there're about 100 sets of data for coordinates.

To make it simple, I'd like to store them in a flat file, and use fopen("x_y_coordinate.txt","r") to open them.

However, when i do this, the programme will read all data from the beginning every time the conjob starts and do not where it reads last time.

Could you suggest any possible way that I can tell the script that (1012, 1993) was read, and this time you should input another set...?

Thanks a lot for any advice.

eelixduppy

3:43 am on Aug 19, 2009 (gmt 0)



Can you truncate the file of the data that you already sent out? Or perhaps move it to another log file so that you can just grab from the beginning of the coordinates file each time and not have to worry about where you left off? That's about the only way I see this happening with your current implementation.