Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Reading files backwards

Name: Anonymous 2009-06-16 3:50

how do you read files backwards in C?

Name: Anonymous 2009-06-16 3:53

read the whole file into a string, then call string.reverse (which you will define), then it's just a mattSegmentation Fault

Name: Anonymous 2009-06-16 3:56

for(;;)
{ fread(buffa, 1, 1, files);
  fseek(files, -2, SEEK_CUR); }

Name: Anonymous 2009-06-16 3:56

>>2
 not funny. I mean what to do to make fseek work backwards.

Name: Anonymous 2009-06-16 3:57

>>3
thx

Name: Anonymous 2009-06-16 4:20

tac

Name: Anonymous 2009-06-16 4:24

;)"r" ,"f"(nepof = f* ELIF

Name: MILKRIBS4k 2009-06-16 4:45

>>7
wwwwwwwww

Name: Anonymous 2009-06-16 4:54

How did I formulate questions in a way that produces usable answers?

Name: Anonymous 2009-06-16 5:47

>>9
i dunno lol

Name: Anonymous 2009-06-16 7:49

>>4
man fseek

Name: Anonymous 2009-06-16 8:22

USE MMAP. THREAD FUCKING OVER.

Name: Anonymous 2009-06-16 8:28

>>2
I actually did that the first time I had to read in a file backwards :( I read in the files in chunks and pushed those onto a stack. Then as I popped the chunks off again, I copied them into a buffer rear-end first. It worked, but when I remembered fseek I wanted to kill myself.

Name: Anonymous 2009-06-16 8:29

I wanted to kill myself.

YOU MIGHT AS WELL DO IT.

Name: Anonymous 2009-06-16 8:30

>>14
It was over a fucking year ago, I wouldn't make that mistake now

Name: Anonymous 2009-06-16 8:31

>>12
writing programs
won't work on windows

Pick one.

Name: Anonymous 2009-06-16 8:34

>>15
MAYBE YOU SHOULD CONSIDER THE POSSIBILITY IT IS NOT A MISTAKE AT ALL.

Name: Anonymous 2009-06-16 9:01

>>13
>>15
the first time I had to read in a file
a fucking year ago
:(

Name: Anonymous 2009-06-16 14:47

>>18
finish the quote!
the first time I had to read in a file backwards
I'd been programming for 2 years at that point (I was taught VB in high school :( ) and had worked with files, but I'd never had to read them backwards.(That's what tac is for)

Name: Anonymous 2011-02-04 20:00


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List