George Neuner <gneu…@comcast.net> writes:
> > lseek() is not guaranteed to work with special files - only open(), > close() and stat() are guaranteed for them. > > lseek() may work for special files currently - or it may work in > whatever disto Steve happens to be using ... but it is not guaranteed > by any documentation, and it may not continue to work in the future. > > I wouldn't rely on it.
I appreciate that; I am rather used to this. What do you use to determine the file size on EXT2?
> Also you can stat() a file without opening it.
Please read lskeek (2). `` lseek() allows the file offset to be set beyond the end of the file (but this does not change the size of the file). If data is later written at this point, subsequent reads of the data in the gap (a "hole") return null bytes ('\0') until data is actually written into the gap. RETURN VALUE Upon successful completion, lseek() returns the resulting offset location as measured in bytes from the beginning of the file. On error, the value (off_t) -1 is returned and errno is set to indicate the error. '' anywayz needed some gestalt therapy. You 2 are worth every penny :) Seriously you guys could provide actually implementation stuff or just complain. What is wrong with it? It was written by me. The real issue is having an executable stack and loading an executable, stored past the end of the file, and loading it directly into a stack function! I though that was rather cool when I was 13.