Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: position in file when saving |
| Date | 2016-03-24 15:06 -0700 |
| Organization | None to speak of |
| Message-ID | <lnbn635y50.fsf@kst-u.example.com> (permalink) |
| References | (3 earlier) <c3b8fbl1mcrb0uskrq7a696tndqvmnubgu@4ax.com> <nd1ejf$nhb$1@dont-email.me> <c9f3dd5c-f258-4664-ab5a-fa3aa65dae5e@googlegroups.com> <lnk2kr644j.fsf@kst-u.example.com> <b1c65b9d-879e-4ac2-b7f4-1624171fce73@googlegroups.com> |
supercat@casperkitty.com writes:
> On Thursday, March 24, 2016 at 2:57:28 PM UTC-5, Keith Thompson wrote:
>> supercat writes:
>> > Is there any requirement that the previous call to ftell() must
>> > have been performed within the current execution of the program?
>> > Also, by what means if any could a current-position-relative
>> > fseek() ever have meaningfully- defined behavior?
>>
>> Have you checked N1570 7.21.9.2?
>
> I should have omitted the follow-on question, but I think the first is
> valid and the cited section doesn't mention it. The possibility that the
> call may have been made on a previous execution of the program isn't
> merely a theoretical exercise. Some implementations of "fortune" have
> an index file that contains the offset to the start of each entry in the
> main text file; is such an approach guaranteed to work?
It says "a value returned by an earlier successful call to the ftell
function on a stream associated with the same file". If it said "the
same stream", I'd say it has to be within the current execution, but a
*file* can persist across multiple executions, or even executions of
different programs. (That's pretty much what files are for, after all.)
My interpretation is that it can use a saved position from a previous
execution. (Unless of course the file has changed, but the committee
left that can of worms closed, or at least indeterminate.)
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
position in file when saving fir <profesor.fir@gmail.com> - 2016-03-24 08:29 -0700
Re: position in file when saving Barry Schwarz <schwarzb@dqel.com> - 2016-03-24 10:11 -0700
Re: position in file when saving fir <profesor.fir@gmail.com> - 2016-03-24 10:51 -0700
Re: position in file when saving Robert Wessel <robertwessel2@yahoo.com> - 2016-03-24 13:07 -0500
Re: position in file when saving Stephen Sprunk <stephen@sprunk.org> - 2016-03-24 14:22 -0500
Re: position in file when saving supercat@casperkitty.com - 2016-03-24 12:40 -0700
Re: position in file when saving Keith Thompson <kst-u@mib.org> - 2016-03-24 12:57 -0700
Re: position in file when saving supercat@casperkitty.com - 2016-03-24 13:15 -0700
Re: position in file when saving Keith Thompson <kst-u@mib.org> - 2016-03-24 15:06 -0700
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-24 20:29 -0400
Re: position in file when saving Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-03-25 01:42 +0000
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-24 23:07 -0400
Re: position in file when saving Ian Collins <ian-news@hotmail.com> - 2016-03-25 16:21 +1300
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-25 09:00 -0400
Re: position in file when saving Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-03-25 11:07 +0000
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-25 09:06 -0400
Re: position in file when saving Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-03-25 14:22 +0000
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-25 10:57 -0400
Re: position in file when saving Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-03-25 16:31 +0000
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-25 12:36 -0400
Re: position in file when saving luser droog <luser.droog@gmail.com> - 2016-03-25 09:49 -0700
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-25 13:00 -0400
Re: position in file when saving Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-03-25 20:35 +0000
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-25 16:59 -0400
Re: position in file when saving Ian Collins <ian-news@hotmail.com> - 2016-03-26 10:46 +1300
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-25 20:22 -0400
Re: position in file when saving Ian Collins <ian-news@hotmail.com> - 2016-03-26 13:42 +1300
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-26 09:17 -0400
Re: position in file when saving supercat@casperkitty.com - 2016-03-26 07:50 -0700
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-26 21:37 -0400
Re: position in file when saving supercat@casperkitty.com - 2016-03-27 08:14 -0700
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-27 12:45 -0400
Re: position in file when saving supercat@casperkitty.com - 2016-03-27 12:20 -0700
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-27 17:07 -0400
Re: position in file when saving supercat@casperkitty.com - 2016-03-27 14:15 -0700
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-27 17:26 -0400
Re: position in file when saving Ken Brody <kenbrody@spamcop.net> - 2016-03-28 10:36 -0400
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-28 11:01 -0400
Re: position in file when saving David Brown <david.brown@hesbynett.no> - 2016-03-29 10:18 +0200
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-29 09:02 -0400
Re: position in file when saving Ian Collins <ian-news@hotmail.com> - 2016-03-30 08:24 +1300
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-29 15:57 -0400
Re: position in file when saving Ian Collins <ian-news@hotmail.com> - 2016-03-30 09:04 +1300
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-29 16:22 -0400
Re: position in file when saving Ian Collins <ian-news@hotmail.com> - 2016-03-31 17:31 +1300
Re: position in file when saving gazelle@shell.xmission.com (Kenny McCormack) - 2016-03-31 09:55 +0000
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-31 10:01 -0400
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-29 16:31 -0400
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-30 17:27 -0400
Re: position in file when saving Ian Collins <ian-news@hotmail.com> - 2016-03-31 16:19 +1300
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-31 10:06 -0400
Re: position in file when saving Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-03-29 05:21 -0700
Re: position in file when saving Jerry Stuckle <jstucklex@attglobal.net> - 2016-03-29 09:05 -0400
Re: position in file when saving Ken Brody <kenbrody@spamcop.net> - 2016-03-25 14:33 -0400
Re: position in file when saving Keith Thompson <kst-u@mib.org> - 2016-03-25 11:38 -0700
Re: position in file when saving supercat@casperkitty.com - 2016-03-25 14:05 -0700
Re: position in file when saving Nick Bowler <nbowler@draconx.ca> - 2016-03-28 16:14 +0000
Re: position in file when saving Tim Rentsch <txr@alumni.caltech.edu> - 2016-03-30 09:31 -0700
Re: position in file when saving Ian Collins <ian-news@hotmail.com> - 2016-03-25 15:06 +1300
Re: position in file when saving Ian Collins <ian-news@hotmail.com> - 2016-03-25 15:00 +1300
Re: position in file when saving Les Cargill <lcargill99@comcast.com> - 2016-03-24 22:15 -0500
csiph-web