FUCK PHP IS A WHORE
1
Name:
Anonymous
2009-07-26 17:11
I want to read the subject.txt, but it's 1,5 mebibyte of data that I don't want to be read every time I run the script. How do I make it read the file lazily?
2
Name:
Anonymous
2009-07-26 17:29
Use Haskell .
3
Name:
Anonymous
2009-07-26 17:32
>>2
Yeah that's what I'd normally do, but FUCK I HAVE TO USE PHP NOW. I need to write some fibs.
4
Name:
Anonymous
2009-07-26 17:33
How about you just read the part you want?
5
Name:
Anonymous
2009-07-26 17:42
>>4
http://pl2.php.net/manual/en/function.file.php
Reads an entire file into an array.
Entire file , you anus!
6
Name:
Anonymous
2009-07-26 17:53
>>5
How about
fopen(), you anus!
7
Name:
Anonymous
2009-07-26 17:59
8
Name:
Anonymous
2009-07-26 18:02
>>1
Can't you
fseek() in PHP?
9
Name:
Anonymous
2009-07-26 18:05
>>7
I spread my anus wide as the Atlantic ocean, and it devours you head to foot like a slobbery wet stinking sarlacc dripping with bits of corn
10
Name:
Anonymous
2009-07-26 18:10
>>8
How is that related? When I have
fopen() I can just
fgets() what I want.
>>7
What do you mean?
11
Name:
Anonymous
2009-07-26 18:31
>>10
Protip:
fopen() and
fgets() don't read the whole file into memory every time. It already works the way you want it to.
12
Name:
Anonymous
2009-07-26 18:49
13
Name:
Anonymous
2009-07-26 18:50
Some clarification: I just said that fopen() and fgets() do what I want, and you said exactly he same. HIBOT?
14
Name:
Anonymous
2009-07-26 19:14
# while true; do wget subject.txt; done
15
Name:
Anonymous
2009-07-26 20:23
16
Name:
Anonymous
2009-07-27 14:57
ok i did that thanks
17
Name:
Anonymous
2009-07-27 15:03
Just use fopen and fgets like you always have. file_get_contents is just a wrapper around fopen fgets fclose, the PHP manual says so itself. but damn if it doesn't save me from writing 3 more lines of code
19
Name:
Anonymous
2011-02-03 1:40