Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Rewind file offset

Reply
Thread Tools

Rewind file offset

 
 
Kuhl
Guest
Posts: n/a
 
      04-10-2009
Hi, I am programming with C in Linux. During reading a file, I need to
rewind the file offset backwards sometimes. I learned that lseek()
function can check the offset. But I did not find a way to set the
offset. I tried using read(fd, databuf, -5), but the offset does not
go back. What's the correct way to rewind the file offset? Thanks.
 
Reply With Quote
 
 
 
 
Kenny McCormack
Guest
Posts: n/a
 
      04-10-2009
In article <(E-Mail Removed)>,
Kuhl <(E-Mail Removed)> wrote:
>Hi, I am programming with C in Linux. During reading a file, I need to
>rewind the file offset backwards sometimes. I learned that lseek()
>function can check the offset. But I did not find a way to set the
>offset. I tried using read(fd, databuf, -5), but the offset does not
>go back. What's the correct way to rewind the file offset? Thanks.


With lseek().

 
Reply With Quote
 
 
 
 
Martin Ambuhl
Guest
Posts: n/a
 
      04-10-2009
Kenneth Brody wrote:
> Richard wrote:
>> Joe Wright <(E-Mail Removed)> writes:

> [...]
>>> lseek() and read() are POSIX, not C. Read up on the following..

>>
>> Of course they are C. Don't talk such utter nonsense.

>
> Strange... My system's manual tells me that lseek() and read() are
> POSIX (along with some other non-C standards like "SVr4" and "BSD 4.3").


And now you know why Richard <no last name> posts anonymously: to post
nonsense with no consequences. For some strange reason there are people
who deny that "troll" is appropriate for this anonymous poster who posts
garbage and snipes at those who know better C than he does.
 
Reply With Quote
 
Kenny McCormack
Guest
Posts: n/a
 
      04-11-2009
In article <gro7uf$4q3$(E-Mail Removed)>,
Martin Ambuhl <(E-Mail Removed)> bleated:
....
>And now you know why Richard <no last name> posts anonymously: to post
>nonsense with no consequences. For some strange reason there are people
>who deny that "troll" is appropriate for this anonymous poster who posts
>garbage and snipes at those who know better C than he does.


Yes. We see that you do this all the time.

But we tolerate you. It is a free country.

 
Reply With Quote
 
Richard Bos
Guest
Posts: n/a
 
      04-13-2009
http://www.velocityreviews.com/forums/(E-Mail Removed) (Kenny McCormack) wrote:

> Martin Ambuhl <(E-Mail Removed)> bleated:
> ...
> >And now you know why Richard <no last name> posts anonymously: to post
> >nonsense with no consequences. For some strange reason there are people
> >who deny that "troll" is appropriate for this anonymous poster who posts
> >garbage and snipes at those who know better C than he does.

>
> Yes. We see that you do this all the time.
>
> But we tolerate you.


What a pathetic little lie, Kenny.

Richard
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing offset-aware and offset-naive datetimes? Roy Smith Python 4 01-27-2013 03:17 PM
how to rewind to file beginning immediately after writing... Rajorshi Biswas C Programming 3 07-20-2006 01:03 PM
Strategy for read and rewind file for unordered data iksrazal@terra.com.br Java 2 08-26-2005 03:01 PM
[BUG] File#rewind, File#syswrite, File#pos on Cygwin build Alan Davies Ruby 7 11-27-2003 04:52 PM
Translated Offset to Source Offset Lance Riedel XML 2 10-15-2003 03:04 PM



Advertisments