0

Hi Everyone,

I haven't started coding or anything but I need to know if it's possible to read a file from last read position? I want to read a file and dump the content into a MySQL database but don't want to read the entire file from start to end everytime I open it.

Is this possible in PHP?

Regards

2
Contributors
2
Replies
15
Views
3 Years
Discussion Span
Last Post by LRNPHP
1

Yes, I suppose you can. You just have to decide where you want to keep the data about the last read position - in the DB too?

files:  id | filename | content | last_position

This should work if only one person is doing the reading. if however more than one person can read the same file...

files:  id | filename | content
read:   user_id | file_id | last_position (Compound PK on first 2 fields)
0

Hi Diafol,

Thanks for the feedback, at this stage it will be 1 person / cronjob only.

Regards

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.