Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 80713 - Error for fseek() / fwrite() operation
Summary: Error for fseek() / fwrite() operation
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 7.3
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2002-12-30 12:29 UTC by Jean-Jacques Sarton
Modified: 2016-11-24 14:58 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-10-03 10:23:50 UTC

Attachments (Terms of Use)

Description Jean-Jacques Sarton 2002-12-30 12:29:00 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.72 [de] (X11; I; Linux 2.2.14 i586)

Description of problem:
The following code don't work:

fp = fopen("file", "r+");
pos = ftell(fp);
printf("Positionned at %d\n",pos);
fwrite(data, 100, 1 fp);
pos = ftell(fp);
printf("Positionned at %d\n",pos);

The data pointed by data are written at offset 0.
Ftell() report that all is OK.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. see above

Actual Results:  Positionned at 20
Positionned at 120

In fact the data was written at offset 0!

Expected Results:  proper work

Additional info:

Comment 1 Jakub Jelinek 2003-01-07 16:46:05 UTC
You haven't specified how big file initially is.
If I create it empty (ie. touch file before running the prog),
I certainly cannot reproduce this, the data is written at offset 20 till
offset 120.

Comment 2 Ulrich Drepper 2003-10-03 10:23:50 UTC
No reply in almost nine months.  We cannot reproduce a problem.  Closing the bug

Note You need to log in before you can comment on or make changes to this bug.