RE: random access file with php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In order to uses random access, you should, indeed, use fseek().

But then you need to know how how your file looks like,
that is, each record must be of either fixed lenght, or
each record should store a "pointer" about how long they
are.

Any file polated with lumps wont do here.

Why is this needed? Simply becuase fseek() moves the read
head to a certain position in your file, and if you don't
know what position you like to go to then fseek() is kind
of useless.

Anyhow, there are tutorial on how to do random access reading:

The two first hit I had on google when searching on 
"turotial random access fseek" was:

http://crasseux.com/books/ctutorial/File-position.html

http://www.cms.livjm.ac.uk/library/cd2018/Coursework%202/random_access_files
.doc

and they seams to be oki - spent 5 second checking them
out thouhg - so you might like to check out the other +400
hits to. Oki, just start read, and then have happy hacking.

Have fun!




-----Original Message-----
From: Idur
To: php-windows@lists.php.net
Sent: 2003-12-20 07:19
Subject:  random access file with php

Hi there,

I have a big file txt to read(about 40 Mb), and i have
script to read this file, suddenly i realise that my
methode to read file is using "sequential access"
mode, but this process take time to
long(max_time_execution = 90) and i need the methode
to read in "random access" with php, i heared that
random access is more fastest than sequential access,
where i can get the tutorial about file operations
(random access mode) using php. 
Because it's very little informations that i can get
from php manual about random access mode(they told to
use fseek) or i don't the right place or right site to
get this informations.

thanx

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux