Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #67230 > unrolled thread
| Started by | fl <rxjwg98@gmail.com> |
|---|---|
| First post | 2015-08-12 15:28 -0700 |
| Last post | 2015-08-14 09:03 -0700 |
| Articles | 20 on this page of 164 — 27 participants |
Back to article view | Back to comp.lang.c
How to read a data file whose size is unknown in C? fl <rxjwg98@gmail.com> - 2015-08-12 15:28 -0700
Re: How to read a data file whose size is unknown in C? Richard Heathfield <rjh@cpax.org.uk> - 2015-08-12 23:52 +0100
Re: How to read a data file whose size is unknown in C? fl <rxjwg98@gmail.com> - 2015-08-12 16:13 -0700
Re: How to read a data file whose size is unknown in C? Richard Heathfield <rjh@cpax.org.uk> - 2015-08-13 00:33 +0100
Re: How to read a data file whose size is unknown in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-13 00:06 +0000
Re: How to read a data file whose size is unknown in C? raltbos@xs4all.nl (Richard Bos) - 2015-08-13 20:50 +0000
Re: How to read a data file whose size is unknown in C? Stephen Sprunk <stephen@sprunk.org> - 2015-08-17 13:38 -0500
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-17 14:48 -0400
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-18 11:10 +0100
Re: How to read a data file whose size is unknown in C? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-18 15:01 +0100
Re: How to read a data file whose size is unknown in C? gordonb.8n5lc@burditt.org (Gordon Burditt) - 2015-08-14 02:33 -0500
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-14 10:06 +0200
Re: How to read a data file whose size is unknown in C? Richard Heathfield <rjh@cpax.org.uk> - 2015-08-14 09:14 +0100
Re: How to read a data file whose size is unknown in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-14 21:27 +0000
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-15 09:52 +0200
Re: How to read a data file whose size is unknown in C? Nobody <nobody@nowhere.invalid> - 2015-08-15 01:17 +0100
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-15 10:27 +0200
Re: How to read a data file whose size is unknown in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-15 18:09 +0000
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-15 22:05 +0200
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-15 19:17 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-15 13:50 -0700
Re: How to read a data file whose size is unknown in C? Richard Heathfield <rjh@cpax.org.uk> - 2015-08-15 21:37 +0100
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-15 23:33 +0200
Re: How to read a data file whose size is unknown in C? Richard Heathfield <rjh@cpax.org.uk> - 2015-08-15 22:58 +0100
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-16 00:08 +0200
Re: How to read a data file whose size is unknown in C? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-16 00:40 +0100
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-16 02:23 +0200
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-15 19:37 -0700
Re: How to read a data file whose size is unknown in C? gazelle@shell.xmission.com (Kenny McCormack) - 2015-08-16 15:35 +0000
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-16 10:31 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-15 19:21 -0700
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-15 23:31 +0200
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-16 03:38 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-16 17:29 -0700
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-17 01:46 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-17 09:03 -0700
Re: How to read a data file whose size is unknown in C? Nobody <nobody@nowhere.invalid> - 2015-08-16 03:23 +0100
Re: How to read a data file whose size is unknown in C? Philip Lantz <prl@canterey.us> - 2015-08-17 00:56 -0700
Re: How to read a data file whose size is unknown in C? Philip Lantz <prl@canterey.us> - 2015-08-17 01:08 -0700
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-17 10:20 +0200
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-17 09:01 -0700
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-15 11:31 +0100
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-15 14:01 -0700
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-15 22:28 +0100
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-15 19:29 -0700
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-16 10:50 +0100
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-16 17:40 -0700
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-16 20:22 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-16 21:27 -0700
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-17 01:31 -0700
Re: How to read a data file whose size is unknown in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-17 20:25 +0000
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-17 16:29 -0700
Re: How to read a data file whose size is unknown in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-17 23:43 +0000
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-17 18:20 -0700
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-17 19:10 -0700
Re: How to read a data file whose size is unknown in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-18 05:26 +0000
Re: How to read a data file whose size is unknown in C? raltbos@xs4all.nl (Richard Bos) - 2015-08-22 14:23 +0000
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-18 04:23 -0700
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-18 17:39 -0700
Re: How to read a data file whose size is unknown in C? Ike Naar <ike@iceland.freeshell.org> - 2015-08-18 16:49 +0000
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-18 17:42 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-18 19:57 -0700
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-19 16:12 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-19 18:04 -0700
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-20 16:52 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-20 18:18 -0700
Re: How to read a data file whose size is unknown in C? raltbos@xs4all.nl (Richard Bos) - 2015-08-21 20:39 +0000
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-21 17:17 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-21 19:35 -0700
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-22 18:28 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-22 22:43 -0700
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-22 00:07 -0400
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-22 18:59 -0700
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-22 23:22 -0400
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-23 19:17 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-23 21:35 -0700
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-24 16:59 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-24 17:57 -0700
Re: How to read a data file whose size is unknown in C? Philip Lantz <prl@canterey.us> - 2015-08-25 01:09 -0700
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-25 19:03 -0700
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-25 22:16 -0400
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-26 14:29 -0700
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-26 18:28 -0400
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-26 19:25 -0700
Re: How to read a data file whose size is unknown in C? David Brown <david.brown@hesbynett.no> - 2015-08-27 10:07 +0200
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-27 09:18 -0700
Re: How to read a data file whose size is unknown in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-27 18:04 +0000
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-27 11:15 -0700
Re: How to read a data file whose size is unknown in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-27 21:10 +0000
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-27 15:54 -0700
Re: How to read a data file whose size is unknown in C? David Brown <david.brown@hesbynett.no> - 2015-08-28 09:28 +0200
Re: How to read a data file whose size is unknown in C? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-08-27 13:12 -0600
Re: How to read a data file whose size is unknown in C? David Brown <david.brown@hesbynett.no> - 2015-08-28 09:35 +0200
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-25 04:28 -0700
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-24 00:19 -0400
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-24 00:31 -0700
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-24 17:06 -0700
Re: How to read a data file whose size is unknown in C? raltbos@xs4all.nl (Richard Bos) - 2015-08-22 14:25 +0000
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-22 10:45 -0400
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-21 17:40 -0400
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-19 00:40 -0400
Re: How to read a data file whose size is unknown in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-19 05:38 +0000
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-19 10:20 -0400
Re: How to read a data file whose size is unknown in C? raltbos@xs4all.nl (Richard Bos) - 2015-08-22 14:22 +0000
Re: How to read a data file whose size is unknown in C? raltbos@xs4all.nl (Richard Bos) - 2015-08-22 14:21 +0000
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-14 08:48 -0400
Re: How to read a data file whose size is unknown in C? fl <rxjwg98@gmail.com> - 2015-08-12 16:21 -0700
Re: How to read a data file whose size is unknown in C? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-08-12 19:44 -0600
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-12 22:04 -0400
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-13 00:44 +0100
Re: How to read a data file whose size is unknown in C? Richard Heathfield <rjh@cpax.org.uk> - 2015-08-13 01:04 +0100
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-13 11:31 +0100
Re: How to read a data file whose size is unknown in C? Richard Heathfield <rjh@cpax.org.uk> - 2015-08-13 11:51 +0100
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-13 08:49 -0700
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-13 17:45 +0100
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-14 11:11 +0100
Re: How to read a data file whose size is unknown in C? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-14 11:34 +0100
Re: How to read a data file whose size is unknown in C? Robert Wessel <robertwessel2@yahoo.com> - 2015-08-14 12:21 -0500
Re: How to read a data file whose size is unknown in C? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-14 19:07 +0100
Re: How to read a data file whose size is unknown in C? Robert Wessel <robertwessel2@yahoo.com> - 2015-08-14 16:08 -0500
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-15 09:51 +0200
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-15 12:36 -0700
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-15 22:26 +0200
Re: How to read a data file whose size is unknown in C? raltbos@xs4all.nl (Richard Bos) - 2015-08-22 14:26 +0000
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-22 08:11 -0700
Re: How to read a data file whose size is unknown in C? Robert Wessel <robertwessel2@yahoo.com> - 2015-08-16 00:05 -0500
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-16 09:08 -0400
Re: How to read a data file whose size is unknown in C? gazelle@shell.xmission.com (Kenny McCormack) - 2015-08-16 15:22 +0000
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-16 17:28 -0700
Re: How to read a data file whose size is unknown in C? Tonton Th <tTh@nowhere.invalid> - 2015-08-14 11:06 +0000
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-14 09:28 -0700
Re: How to read a data file whose size is unknown in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-13 18:56 +0000
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-13 13:39 -0700
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-14 00:21 +0100
Re: How to read a data file whose size is unknown in C? Ian Collins <ian-news@hotmail.com> - 2015-08-14 12:26 +1200
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-14 11:00 +0100
Re: How to read a data file whose size is unknown in C? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-14 11:30 +0100
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-14 12:31 +0100
Re: How to read a data file whose size is unknown in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 04:51 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-14 09:21 -0700
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-14 09:23 -0700
Re: How to read a data file whose size is unknown in C? David Kleinecke <dkleinecke@gmail.com> - 2015-08-14 16:57 -0700
Re: How to read a data file whose size is unknown in C? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-08-15 14:49 -0600
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-15 19:31 -0700
Re: How to read a data file whose size is unknown in C? Richard Heathfield <rjh@cpax.org.uk> - 2015-08-14 00:35 +0100
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-14 08:57 -0700
Re: How to read a data file whose size is unknown in C? Bartc <bc@freeuk.com> - 2015-08-14 17:28 +0100
Re: How to read a data file whose size is unknown in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-13 00:12 +0000
Re: How to read a data file whose size is unknown in C? Lőrinczy Zsigmond <nospam@for.me> - 2015-08-13 07:03 +0200
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-13 12:38 +0200
Re: How to read a data file whose size is unknown in C? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-13 13:32 +0100
Re: How to read a data file whose size is unknown in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-13 14:49 +0200
Re: How to read a data file whose size is unknown in C? Richard Heathfield <rjh@cpax.org.uk> - 2015-08-13 14:05 +0100
Re: How to read a data file whose size is unknown in C? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-13 14:50 +0100
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-13 09:14 -0700
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-13 12:42 -0400
Re: How to read a data file whose size is unknown in C? Ken Brody <kenbrody@spamcop.net> - 2015-08-13 10:56 -0400
Re: How to read a data file whose size is unknown in C? Keith Thompson <kst-u@mib.org> - 2015-08-13 09:16 -0700
Re: How to read a data file whose size is unknown in C? Lőrinczy Zsigmond <zsiga@nospam.for.me> - 2015-08-13 18:12 +0200
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-13 12:50 -0400
Re: How to read a data file whose size is unknown in C? Lőrinczy Zsigmond <nospam@for.me> - 2015-08-13 20:07 +0200
Re: How to read a data file whose size is unknown in C? James Kuyper <jameskuyper@verizon.net> - 2015-08-13 14:38 -0400
Re: How to read a data file whose size is unknown in C? John Bode <jfbode1029@gmail.com> - 2015-08-13 09:30 -0700
Re: How to read a data file whose size is unknown in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-14 09:03 -0700
Page 2 of 9 — ← Prev page 1 [2] 3 4 5 6 7 8 9 Next page →
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2015-08-15 13:50 -0700 |
| Message-ID | <lnd1yo9syp.fsf@kst-u.example.com> |
| In reply to | #67450 |
jacobnavia <jacob@jacob.remcomp.fr> writes:
> Le 15/08/2015 02:17, Nobody a écrit :
>> On Fri, 14 Aug 2015 10:06:35 +0200, jacobnavia wrote:
>>
>>> Le 14/08/2015 09:33, Gordon Burditt a écrit :
>>>> (read the C standard's description of fseek() and ftell()) which may not
>>>> even*HAVE* a byte-granular file size (example: CP/M 1.4, where file
>>>> sizes were in multiples of 128 bytes on IBM single-density floppies)
>>>
>>> It *could* be interesting to recall that CP/M doesn't exist since at least
>>> 35 years. Concerning the IBM single density floppies... well that is the
>>> same situation. 36 years old.
>>
>> CP/M is no longer widely used,
>
> Thanks. At least you acknowledge that.
>
> May I remind you that NOWHERE in your message you mentioned that CP/M is
> no longer used since MSDOS, around 30 years ago?????
You already mentioned it. Why should he bother to repeat it?
> For "young" people (under 40 years old) CP/M never existed!
>
> but various versions of Windows are, and
>> they still maintain compatibility with certain aspects of CP/M's
>> filesystem semantics.
>>
>
> This is also not true. It was MSDOS that (to be compatible with CP/M)
> continued using ctrl-z as EOF marker in its version 1.0. But beginning
> with the version 2.0 of MSDOS (1983, 32 years ago!!!) CTRL-Z was no
> longer any special character!!!
>
> This means that Windows NEVER used Ctrl-z for end of file. Windows uses
> Ctrl-z as the UNDO command.
>
> You are just writing NONSENSE!
That doesn't match what I had though. It's entirely possible that
I'm mistaken.
(Ctrl-Z is used in Windows interactive keyboard input to trigger and
end-of-file condition, much like the default treatment of Ctrl-D in
Unix. That's a distinct matter, not relevant to file contents.)
I had thought that Windows still used a Ctrl-Z character (character 26,
'\x1a') to mark end-of-file in on-disk text files.
I don't currently have access to a Windows systems, so I can't test this
myself. Can you please compile and run the following program under
Windows and let us know what output it produces? (The error handling is
crude.)
#include <stdio.h>
#include <stdlib.h>
int main(void) {
const char CTRL_Z = 26;
int c;
FILE *f = fopen("foo.txt", "w");
if (f == NULL) exit(EXIT_FAILURE);
fprintf(f, "one\n%ctwo\n", CTRL_Z);
fclose(f);
f = fopen("foo.txt", "r");
if (f == NULL) exit(EXIT_FAILURE);
while ((c = getc(f)) != EOF) {
if (c == CTRL_Z) {
fputs("^Z", stdout);
}
else {
putchar(c);
}
}
close(f);
return 0;
}
On my Linux system, its output is:
one
^Ztwo
If my recollection of how Windows treats text files is correct, its
output on Windows would be just "one". I'm primarily interested in the
output using Microsoft's implementation, though the results under your
lcc-win would also be interesting.
[...]
--
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"
[toc] | [prev] | [next] | [standalone]
| From | Richard Heathfield <rjh@cpax.org.uk> |
|---|---|
| Date | 2015-08-15 21:37 +0100 |
| Message-ID | <xqNzx.282639$GZ.130476@fx21.am4> |
| In reply to | #67465 |
On 15/08/2015 21:50, Keith Thompson wrote:
> jacobnavia<jacob@jacob.remcomp.fr> writes:
>> Le 15/08/2015 02:17, Nobody a écrit :
>>> On Fri, 14 Aug 2015 10:06:35 +0200, jacobnavia wrote:
>>>
>>>> Le 14/08/2015 09:33, Gordon Burditt a écrit :
>>>>> (read the C standard's description of fseek() and ftell()) which may not
>>>>> even*HAVE* a byte-granular file size (example: CP/M 1.4, where file
>>>>> sizes were in multiples of 128 bytes on IBM single-density floppies)
>>>>
>>>> It *could* be interesting to recall that CP/M doesn't exist since at least
>>>> 35 years. Concerning the IBM single density floppies... well that is the
>>>> same situation. 36 years old.
>>>
>>> CP/M is no longer widely used,
>>
>> Thanks. At least you acknowledge that.
>>
>> May I remind you that NOWHERE in your message you mentioned that CP/M is
>> no longer used since MSDOS, around 30 years ago?????
>
> You already mentioned it. Why should he bother to repeat it?
>
>> For "young" people (under 40 years old) CP/M never existed!
>>
>> but various versions of Windows are, and
>>> they still maintain compatibility with certain aspects of CP/M's
>>> filesystem semantics.
>>>
>>
>> This is also not true. It was MSDOS that (to be compatible with CP/M)
>> continued using ctrl-z as EOF marker in its version 1.0. But beginning
>> with the version 2.0 of MSDOS (1983, 32 years ago!!!) CTRL-Z was no
>> longer any special character!!!
>>
>> This means that Windows NEVER used Ctrl-z for end of file. Windows uses
>> Ctrl-z as the UNDO command.
>>
>> You are just writing NONSENSE!
>
> That doesn't match what I had though. It's entirely possible that
> I'm mistaken.
>
> (Ctrl-Z is used in Windows interactive keyboard input to trigger and
> end-of-file condition, much like the default treatment of Ctrl-D in
> Unix. That's a distinct matter, not relevant to file contents.)
>
> I had thought that Windows still used a Ctrl-Z character (character 26,
> '\x1a') to mark end-of-file in on-disk text files.
>
> I don't currently have access to a Windows systems, so I can't test this
> myself. Can you please compile and run the following program under
> Windows and let us know what output it produces? (The error handling is
> crude.)
>
> #include<stdio.h>
> #include<stdlib.h>
> int main(void) {
> const char CTRL_Z = 26;
> int c;
>
> FILE *f = fopen("foo.txt", "w");
> if (f == NULL) exit(EXIT_FAILURE);
> fprintf(f, "one\n%ctwo\n", CTRL_Z);
> fclose(f);
>
> f = fopen("foo.txt", "r");
> if (f == NULL) exit(EXIT_FAILURE);
> while ((c = getc(f)) != EOF) {
> if (c == CTRL_Z) {
> fputs("^Z", stdout);
> }
> else {
> putchar(c);
> }
> }
> close(f);
ITYM fclose(f);
> return 0;
> }
>
> On my Linux system, its output is:
>
> one
> ^Ztwo
>
> If my recollection of how Windows treats text files is correct, its
> output on Windows would be just "one". I'm primarily interested in the
> output using Microsoft's implementation, though the results under your
> lcc-win would also be interesting.
Borland gives me
one
I don't have Visual Studio installed on this machine at present. Sorry
about that. But no doubt someone else will oblige.
>
> [...]
>
--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2015-08-15 23:33 +0200 |
| Message-ID | <mqob3v$qgv$2@dont-email.me> |
| In reply to | #67466 |
Le 15/08/2015 22:37, Richard Heathfield a écrit : > Borland gives me > > one Yes, Borland added Ctrl-z honoring code to their RUNTIME library! Obviously (as I know you after all these years) you are still using an MSDOS version of borland. Maybe Turboc that you always praise here :-)
[toc] | [prev] | [next] | [standalone]
| From | Richard Heathfield <rjh@cpax.org.uk> |
|---|---|
| Date | 2015-08-15 22:58 +0100 |
| Message-ID | <bCOzx.249837$pF1.12298@fx41.am4> |
| In reply to | #67473 |
On 15/08/2015 22:33, jacobnavia wrote: > Le 15/08/2015 22:37, Richard Heathfield a écrit : >> Borland gives me >> >> one > > Yes, Borland added Ctrl-z honoring code to their RUNTIME library! > > Obviously (as I know you after all these years) you are still using an > MSDOS version of borland. Maybe Turboc that you always praise here "Obviously" doesn't necessarily mean "correctly". I was actually using the C compiler built into C++ Builder, a Windows application. -- Richard Heathfield Email: rjh at cpax dot org dot uk "Usenet is a strange place" - dmr 29 July 1999 Sig line 4 vacant - apply within
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2015-08-16 00:08 +0200 |
| Message-ID | <mqod51$5gu$1@dont-email.me> |
| In reply to | #67475 |
Le 15/08/2015 23:58, Richard Heathfield a écrit :
> On 15/08/2015 22:33, jacobnavia wrote:
>> Le 15/08/2015 22:37, Richard Heathfield a écrit :
>>> Borland gives me
>>>
>>> one
>>
>> Yes, Borland added Ctrl-z honoring code to their RUNTIME library!
>>
>> Obviously (as I know you after all these years) you are still using an
>> MSDOS version of borland. Maybe Turboc that you always praise here
>
> "Obviously" doesn't necessarily mean "correctly". I was actually using
> the C compiler built into C++ Builder, a Windows application.
>
That compiler is treating specially the ctrl-z.
If you would use lcc-win (god forbid!) you would see:
d:\lcc\temp>type ctrlz.c
#include <stdio.h>
#include <stdlib.h>
int main(void) {
const char CTRL_Z = 26;
int c;
FILE *f = fopen("foo.txt", "w");
if (f == NULL) exit(EXIT_FAILURE);
fprintf(f, "one\n%ctwo\n", CTRL_Z);
fclose(f);
f = fopen("foo.txt", "r");
if (f == NULL) exit(EXIT_FAILURE);
while ((c = getc(f)) != EOF) {
if (c == CTRL_Z) {
fputs("^Z", stdout);
}
else {
putchar(c);
}
}
fclose(f);
return 0;
}
d:\lcc\temp>rem I call the lcc compiler
d:\lcc\temp>lc64 ctrlz.c
d:\lcc\temp>ctrlz
one
^Ztwo
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2015-08-16 00:40 +0100 |
| Message-ID | <87si7kf7da.fsf@bsb.me.uk> |
| In reply to | #67478 |
jacobnavia <jacob@jacob.remcomp.fr> writes:
> Le 15/08/2015 23:58, Richard Heathfield a écrit :
>> On 15/08/2015 22:33, jacobnavia wrote:
>>> Le 15/08/2015 22:37, Richard Heathfield a écrit :
>>>> Borland gives me
>>>>
>>>> one
>>>
>>> Yes, Borland added Ctrl-z honoring code to their RUNTIME library!
>>>
>>> Obviously (as I know you after all these years) you are still using an
>>> MSDOS version of borland. Maybe Turboc that you always praise here
>>
>> "Obviously" doesn't necessarily mean "correctly". I was actually using
>> the C compiler built into C++ Builder, a Windows application.
>
> That compiler is treating specially the ctrl-z.
I don't have a Windows machine to hand, but your lcc-win32 compiler,
running on Windows 7 in VirtualBox gives the output "one" (i.e. it stops
at the Ctrl-Z).
(Program left for reference:
> #include <stdio.h>
> #include <stdlib.h>
> int main(void) {
> const char CTRL_Z = 26;
> int c;
>
> FILE *f = fopen("foo.txt", "w");
> if (f == NULL) exit(EXIT_FAILURE);
> fprintf(f, "one\n%ctwo\n", CTRL_Z);
> fclose(f);
>
> f = fopen("foo.txt", "r");
> if (f == NULL) exit(EXIT_FAILURE);
> while ((c = getc(f)) != EOF) {
> if (c == CTRL_Z) {
> fputs("^Z", stdout);
> }
> else {
> putchar(c);
> }
> }
> fclose(f);
> return 0;
> }
--
Ben.
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2015-08-16 02:23 +0200 |
| Message-ID | <mqol2k$sel$1@dont-email.me> |
| In reply to | #67490 |
Le 16/08/2015 01:40, Ben Bacarisse a écrit : > I don't have a Windows machine to hand, but your lcc-win32 compiler, > running on Windows 7 in VirtualBox gives the output "one" (i.e. it stops > at the Ctrl-Z). Of course. The 32 bit version used MSVCRT.DLL. The 64 bit version (already around 8-9 years old) doesn't. I rewrote the whole C library.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2015-08-15 19:37 -0700 |
| Message-ID | <lnfv3k7ybx.fsf@kst-u.example.com> |
| In reply to | #67496 |
jacobnavia <jacob@jacob.remcomp.fr> writes:
> Le 16/08/2015 01:40, Ben Bacarisse a écrit :
>> I don't have a Windows machine to hand, but your lcc-win32 compiler,
>> running on Windows 7 in VirtualBox gives the output "one" (i.e. it stops
>> at the Ctrl-Z).
>
> Of course. The 32 bit version used MSVCRT.DLL. The 64 bit version
> (already around 8-9 years old) doesn't. I rewrote the whole C library.
The "Of course" seems odd. I had no idea that lcc-win32 uses MSVCRT.DLL
and lcc-win64 uses your own C library implementation.
Based on that, I'd expect that the output of my program (with close()
replaced by fclose(), sorry about that) when compiled using Microsoft's
compiler would be:
one
i.e., that it would treat a Ctrl-Z character in the file as an
end-of-file marker.
Upthread, you wrote:
This is also not true. It was MSDOS that (to be compatible with CP/M)
continued using ctrl-z as EOF marker in its version 1.0. But beginning
with the version 2.0 of MSDOS (1983, 32 years ago!!!) CTRL-Z was no
longer any special character!!!
This means that Windows NEVER used Ctrl-z for end of file. Windows
uses Ctrl-z as the UNDO command.
You are just writing NONSENSE!
And yet it appears that Windows (or more precisely Microsoft's C runtime
library) *does* treat Ctrl-Z as end-of-file. (And the fact that Ctrl-Z
is commmonly used as an undo command is hardly relevant; the issue is
Ctrl-Z characters *stored in a text file*.)
Are you saying that the distinction between Windows and the Microsoft C
runtime library is enough to make the original statement "NONSENSE!"?
I'm having trouble seeing a sense in which Windows *doesn't* treat
Ctrl-Z specially.
--
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"
[toc] | [prev] | [next] | [standalone]
| From | gazelle@shell.xmission.com (Kenny McCormack) |
|---|---|
| Date | 2015-08-16 15:35 +0000 |
| Message-ID | <mqqaje$v6u$2@news.xmission.com> |
| In reply to | #67490 |
In article <87si7kf7da.fsf@bsb.me.uk>,
Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
...
>I don't have a Windows machine to hand,
What a dumb comment to make! Of course you do, as you prove below.
(Note: VM, regular computer, what difference does it make? It's like you
just couldn't resist a little anti-Windows snobbery.)
>but your lcc-win32 compiler,
>running on Windows 7 in VirtualBox gives the output "one" (i.e. it stops
>at the Ctrl-Z).
The fact is that it *is* standard that ^Z marks the end of a DOS/Windows
text file - and this fact will never change. No matter _what_ Jacob thinks.
Some tools pay attention to the ^Z, others ignore it, but the fact is that
it is there and as long as _some_ tools heed its meaning, one has to concede
that it is a part of the culture (a part that will never go away, alas).
Here's another interesting data point:
--- Cut Here ---
C:\Documents and Settings\TheComputer>gvim x7.bat
(create 3 liner that looks like this in GVIM):
echo hello
^Z
echo goodbye
(^Z created by pressing control/v control/z)
(now we run the batch file we just created:)
C:\Documents and Settings\TheComputer>x7
C:\Documents and Settings\TheComputer>echo hello
hello
C:\Documents and Settings\TheComputer>echo goodbye
goodbye
(now we examine the batch file we just created:)
C:\Documents and Settings\TheComputer>type x7.bat
echo hello
C:\Documents and Settings\TheComputer>
--- Cut Here ---
Virus writers, take note!
--
"Women should not be enlightened or educated in any way. They should be
segregated because they are the cause of unholy erections in holy men.
-- Saint Augustine (354-430) --
[toc] | [prev] | [next] | [standalone]
| From | Malcolm McLean <malcolm.mclean5@btinternet.com> |
|---|---|
| Date | 2015-08-16 10:31 -0700 |
| Message-ID | <9bcce562-ef1e-4869-b91b-b9a902e41007@googlegroups.com> |
| In reply to | #67529 |
On Sunday, August 16, 2015 at 4:35:20 PM UTC+1, Kenny McCormack wrote: > > The fact is that it *is* standard that ^Z marks the end of a DOS/Windows > text file - and this fact will never change. No matter _what_ Jacob thinks. > Some tools pay attention to the ^Z, others ignore it, but the fact is that > it is there and as long as _some_ tools heed its meaning, one has to concede > that it is a part of the culture (a part that will never go away, alas). > That's largely out of date. Once upon a time you had a concept of an "ascii machine"or a "windows file". Now it's accepted that pretty much any file can be transferred from one platform to another, with a few exceptions such as executables. So we think of ourselves as being handed data files. It might be ascii, it might be UTF-8, or it might be some undesireable encoding that's a nuisance, but still a trival data reformatting problem to handle. It no longer matters much how character-mapped terminals are encoded. If you have to support such a terminal, you simply translate the characters into the terminal's display set.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2015-08-15 19:21 -0700 |
| Message-ID | <lnvbcg7z32.fsf@kst-u.example.com> |
| In reply to | #67466 |
Richard Heathfield <rjh@cpax.org.uk> writes:
> On 15/08/2015 21:50, Keith Thompson wrote:
[...]
>> #include<stdio.h>
>> #include<stdlib.h>
>> int main(void) {
>> const char CTRL_Z = 26;
>> int c;
>>
>> FILE *f = fopen("foo.txt", "w");
[...]
>> close(f);
> ITYM fclose(f);
Yes, of course. (I compiled using gcc with default settings, and it
didn't complain. Still my fault.)
> Borland gives me
>
> one
>
> I don't have Visual Studio installed on this machine at present. Sorry
> about that. But no doubt someone else will oblige.
Thanks.
--
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"
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2015-08-15 23:31 +0200 |
| Message-ID | <mqob0k$qgv$1@dont-email.me> |
| In reply to | #67465 |
Le 15/08/2015 22:50, Keith Thompson a écrit :
> output using Microsoft's implementation, though the results under your
> lcc-win would also be interesting.
>
> [...]
>
d:\lcc\temp>type ctrlz.c
#include <stdio.h>
#include <stdlib.h>
int main(void) {
const char CTRL_Z = 26;
int c;
FILE *f = fopen("foo.txt", "w");
if (f == NULL) exit(EXIT_FAILURE);
fprintf(f, "one\n%ctwo\n", CTRL_Z);
fclose(f);
f = fopen("foo.txt", "r");
if (f == NULL) exit(EXIT_FAILURE);
while ((c = getc(f)) != EOF) {
if (c == CTRL_Z) {
fputs("^Z", stdout);
}
else {
putchar(c);
}
}
fclose(f);
return 0;
}
d:\lcc\temp>rem note that I replaced the close by fclose at the end
d:\lcc\temp>rem I call the lcc compiler
d:\lcc\temp>lc64 ctrlz.c
d:\lcc\temp>ctrlz
one
^Ztwo
d:\lcc\temp>type foo.txt
one
d:\lcc\temp>cmd
Microsoft Windows [version 10.0.10240]
(c) 2015 Microsoft Corporation. Tous droits r<82>serv<82>s.
d:\lcc\temp>^Z
-------------------------------------------------------------------
The utilities like "type" and others ^probably still use the Ctrl-z.
Bravo Microsoft!
The system, however, doesn't use that since 1983. Note that windows 10
STILL has the same, lovingly preserved, CP/M compatibility
[toc] | [prev] | [next] | [standalone]
| From | Malcolm McLean <malcolm.mclean5@btinternet.com> |
|---|---|
| Date | 2015-08-16 03:38 -0700 |
| Message-ID | <e3b4f1cf-2a50-4aec-b118-8b72e115e2f2@googlegroups.com> |
| In reply to | #67465 |
On Saturday, August 15, 2015 at 9:34:35 PM UTC+1, Keith Thompson wrote:
>
> I don't currently have access to a Windows systems, so I can't test this
> myself. Can you please compile and run the following program under
> Windows and let us know what output it produces? (The error handling is
> crude.)
>
> #include <stdio.h>
> #include <stdlib.h>
> int main(void) {
> const char CTRL_Z = 26;
> int c;
>
> FILE *f = fopen("foo.txt", "w");
> if (f == NULL) exit(EXIT_FAILURE);
> fprintf(f, "one\n%ctwo\n", CTRL_Z);
> fclose(f);
>
> f = fopen("foo.txt", "r");
> if (f == NULL) exit(EXIT_FAILURE);
> while ((c = getc(f)) != EOF) {
> if (c == CTRL_Z) {
> fputs("^Z", stdout);
> }
> else {
> putchar(c);
> }
> }
> close(f);
> return 0;
> }
>
> On my Linux system, its output is:
>
> one
> ^Ztwo
>
> If my recollection of how Windows treats text files is correct, its
>
one
Debug assertion failed
File: minkernel\crts\ucrt\src\appcrt\Iowio\close.cpp
Line 48
Expression : (fh >= 0 && (unsigned)fh < (unsigned) _nhandle)
It didn't like it.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2015-08-16 17:29 -0700 |
| Message-ID | <lntwry7o6a.fsf@kst-u.example.com> |
| In reply to | #67523 |
Malcolm McLean <malcolm.mclean5@btinternet.com> writes:
> On Saturday, August 15, 2015 at 9:34:35 PM UTC+1, Keith Thompson wrote:
>>
>> I don't currently have access to a Windows systems, so I can't test this
>> myself. Can you please compile and run the following program under
>> Windows and let us know what output it produces? (The error handling is
>> crude.)
>>
>> #include <stdio.h>
>> #include <stdlib.h>
>> int main(void) {
>> const char CTRL_Z = 26;
>> int c;
>>
>> FILE *f = fopen("foo.txt", "w");
>> if (f == NULL) exit(EXIT_FAILURE);
>> fprintf(f, "one\n%ctwo\n", CTRL_Z);
>> fclose(f);
>>
>> f = fopen("foo.txt", "r");
>> if (f == NULL) exit(EXIT_FAILURE);
>> while ((c = getc(f)) != EOF) {
>> if (c == CTRL_Z) {
>> fputs("^Z", stdout);
>> }
>> else {
>> putchar(c);
>> }
>> }
>> close(f);
>> return 0;
>> }
>>
>> On my Linux system, its output is:
>>
>> one
>> ^Ztwo
>>
>> If my recollection of how Windows treats text files is correct, its
>>
> one
>
> Debug assertion failed
>
> File: minkernel\crts\ucrt\src\appcrt\Iowio\close.cpp
> Line 48
>
> Expression : (fh >= 0 && (unsigned)fh < (unsigned) _nhandle)
>
> It didn't like it.
That's because I mistakenly write `close(f)` rather than `fclose(f)`.
How does it behave with that error corrected?
--
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"
[toc] | [prev] | [next] | [standalone]
| From | Malcolm McLean <malcolm.mclean5@btinternet.com> |
|---|---|
| Date | 2015-08-17 01:46 -0700 |
| Message-ID | <f693b30f-6720-47ab-ae6b-d8cf1700b368@googlegroups.com> |
| In reply to | #67552 |
On Monday, August 17, 2015 at 1:03:28 AM UTC+1, Keith Thompson wrote:
> Malcolm McLean <malcolm.mclean5@btinternet.com> writes:
> > On Saturday, August 15, 2015 at 9:34:35 PM UTC+1, Keith Thompson wrote:
> >>
> >> I don't currently have access to a Windows systems, so I can't test this
> >> myself. Can you please compile and run the following program under
> >> Windows and let us know what output it produces? (The error handling is
> >> crude.)
> >>
> >> #include <stdio.h>
> >> #include <stdlib.h>
> >> int main(void) {
> >> const char CTRL_Z = 26;
> >> int c;
> >>
> >> FILE *f = fopen("foo.txt", "w");
> >> if (f == NULL) exit(EXIT_FAILURE);
> >> fprintf(f, "one\n%ctwo\n", CTRL_Z);
> >> fclose(f);
> >>
> >> f = fopen("foo.txt", "r");
> >> if (f == NULL) exit(EXIT_FAILURE);
> >> while ((c = getc(f)) != EOF) {
> >> if (c == CTRL_Z) {
> >> fputs("^Z", stdout);
> >> }
> >> else {
> >> putchar(c);
> >> }
> >> }
> >> close(f);
> >> return 0;
> >> }
> >>
> >> On my Linux system, its output is:
> >>
> >> one
> >> ^Ztwo
> >>
> >> If my recollection of how Windows treats text files is correct, its
> >>
> > one
> >
> > Debug assertion failed
> >
> > File: minkernel\crts\ucrt\src\appcrt\Iowio\close.cpp
> > Line 48
> >
> > Expression : (fh >= 0 && (unsigned)fh < (unsigned) _nhandle)
> >
> > It didn't like it.
>
> That's because I mistakenly write `close(f)` rather than `fclose(f)`.
> How does it behave with that error corrected?
>
Now the DOS box opens and closes before you can read the output.
You're not a Windows programmer, are you?
You can open a command prompt, navigate down to the executable,
and run it that way, but it's a nuisance. A real Windows programmer
will add a getchar() to the end.
Doing that, I get
one
So, at least as far as MSVC is concerned, EOF == CTRL-Z.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2015-08-17 09:03 -0700 |
| Message-ID | <ln8u997vhl.fsf@kst-u.example.com> |
| In reply to | #67569 |
Malcolm McLean <malcolm.mclean5@btinternet.com> writes:
> On Monday, August 17, 2015 at 1:03:28 AM UTC+1, Keith Thompson wrote:
[...]
>> That's because I mistakenly write `close(f)` rather than `fclose(f)`.
>> How does it behave with that error corrected?
>>
> Now the DOS box opens and closes before you can read the output.
> You're not a Windows programmer, are you?
No, I'm not.
> You can open a command prompt, navigate down to the executable,
> and run it that way, but it's a nuisance. A real Windows programmer
> will add a getchar() to the end.
>
> Doing that, I get
>
> one
>
> So, at least as far as MSVC is concerned, EOF == CTRL-Z.
Thank you for that information.
--
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"
[toc] | [prev] | [next] | [standalone]
| From | Nobody <nobody@nowhere.invalid> |
|---|---|
| Date | 2015-08-16 03:23 +0100 |
| Message-ID | <pan.2015.08.16.02.24.06.227000@nowhere.invalid> |
| In reply to | #67450 |
On Sat, 15 Aug 2015 10:27:32 +0200, jacobnavia wrote: > This is also not true. It was MSDOS that (to be compatible with CP/M) > continued using ctrl-z as EOF marker in its version 1.0. But beginning > with the version 2.0 of MSDOS (1983, 32 years ago!!!) CTRL-Z was no longer > any special character!!! > > This means that Windows NEVER used Ctrl-z for end of file. Windows uses > Ctrl-z as the UNDO command. > > You are just writing NONSENSE! No, you're adopting your own definition of "Windows", considering the MSVC run-time as being part of the compiler rather than the OS per se (MSDN treats it as being part of the OS). The main problem with that is that a number of OS components (e.g. cmd.exe) use MSVCRT and thus inherit its semantics. Even if executables built with lcc-win don't use MSVCRT directly, I'd be surprised if they don't use it indirectly by virtue of the fact that many standard utilities use it.
[toc] | [prev] | [next] | [standalone]
| From | Philip Lantz <prl@canterey.us> |
|---|---|
| Date | 2015-08-17 00:56 -0700 |
| Message-ID | <MPG.303b337c1b85edf84f@news.eternal-september.org> |
| In reply to | #67450 |
jacobnavia wrote:
> This means that Windows NEVER used Ctrl-z for end of file. Windows
> uses Ctrl-z as the UNDO command.
>
> You are just writing NONSENSE!
>
> > Specifically, if a file is opened in text mode (i.e. no "b" in the second
> > argument to fopen), the implementation will report EOF on encountering a
> > Ctrl-Z character ('\x1a'). It does this because that's how CP/M indicates
> > the end of a text file (the filesystem itself only stores file sizes in
> > terms of the number of blocks, not bytes).
> >
>
> As I wrote before, this is NOT the case since 1983 !!!!!
You're the one writing nonsense. Windows has ALWAYS treated ^Z as EOF.
Try this: (First make sure there's no file named "x" that you care
about.)
#include <stdio.h>
int main()
{
FILE *f = fopen("x", "wb");
fwrite("test\r\n\32line2\r\n", 1, 14, f);
fclose(f);
f = fopen("x", "r");
char buf[20];
int r = fread(buf, 1, 20, f);
printf("r = %d\n", r);
r = fread(buf, 1, 20, f);
printf("r = %d\n", r);
return 0;
}
On my system (Windows 7), it prints
r = 5
r = 0
CLEARLY it is treating the ^Z as an end of file.
After you have run this program, type
C:\> type x
It will print:
test
No "line2" in sight. So it's not just the C runtime library that treats
^Z as EOF; the Microsoft utilities do, too.
I ran this on Windows 8.1, too, with the same result.
[toc] | [prev] | [next] | [standalone]
| From | Philip Lantz <prl@canterey.us> |
|---|---|
| Date | 2015-08-17 01:08 -0700 |
| Message-ID | <MPG.303b364810e48e3850@news.eternal-september.org> |
| In reply to | #67564 |
Philip Lantz wrote:
>
> jacobnavia wrote:
> > This means that Windows NEVER used Ctrl-z for end of file. Windows
> > uses Ctrl-z as the UNDO command.
> >
> > You are just writing NONSENSE!
> >
> > > Specifically, if a file is opened in text mode (i.e. no "b" in the second
> > > argument to fopen), the implementation will report EOF on encountering a
> > > Ctrl-Z character ('\x1a'). It does this because that's how CP/M indicates
> > > the end of a text file (the filesystem itself only stores file sizes in
> > > terms of the number of blocks, not bytes).
> > >
> >
> > As I wrote before, this is NOT the case since 1983 !!!!!
>
> You're the one writing nonsense. Windows has ALWAYS treated ^Z as EOF.
>
> Try this:
<snip>
> So it's not just the C runtime library that treats
> ^Z as EOF; the Microsoft utilities do, too.
Oops, I should have finished the thread before posting; I see this has
been mostly covered. I should point out that I built this with Visual
Studio 2013.
[toc] | [prev] | [next] | [standalone]
| From | jacobnavia <jacob@jacob.remcomp.fr> |
|---|---|
| Date | 2015-08-17 10:20 +0200 |
| Message-ID | <mqs5dp$lgb$1@dont-email.me> |
| In reply to | #67564 |
Le 17/08/2015 09:56, Philip Lantz a écrit :
> jacobnavia wrote:
>> This means that Windows NEVER used Ctrl-z for end of file. Windows
>> uses Ctrl-z as the UNDO command.
>>
>> You are just writing NONSENSE!
>>
>>> Specifically, if a file is opened in text mode (i.e. no "b" in the second
>>> argument to fopen), the implementation will report EOF on encountering a
>>> Ctrl-Z character ('\x1a'). It does this because that's how CP/M indicates
>>> the end of a text file (the filesystem itself only stores file sizes in
>>> terms of the number of blocks, not bytes).
>>>
>>
>> As I wrote before, this is NOT the case since 1983 !!!!!
>
> You're the one writing nonsense. Windows has ALWAYS treated ^Z as EOF.
>
> Try this: (First make sure there's no file named "x" that you care
> about.)
>
>
> #include <stdio.h>
>
> int main()
> {
> FILE *f = fopen("x", "wb");
> fwrite("test\r\n\32line2\r\n", 1, 14, f);
> fclose(f);
>
> f = fopen("x", "r");
> char buf[20];
> int r = fread(buf, 1, 20, f);
> printf("r = %d\n", r);
> r = fread(buf, 1, 20, f);
> printf("r = %d\n", r);
>
> return 0;
> }
>
>
> On my system (Windows 7), it prints
> r = 5
> r = 0
>
> CLEARLY it is treating the ^Z as an end of file.
>
> After you have run this program, type
> C:\> type x
>
> It will print:
> test
>
> No "line2" in sight. So it's not just the C runtime library that treats
> ^Z as EOF; the Microsoft utilities do, too.
>
> I ran this on Windows 8.1, too, with the same result.
>
Look
You used microsoft software. Other systems that do not use that do not
have that problem.
d:\lcc\tmp>type cz.c
#include <stdio.h>
int main()
{
FILE *f = fopen("x", "wb");
fwrite("test\r\n\32line2\r\n", 1, 14, f);
fclose(f);
f = fopen("x", "r");
char buf[20];
int r = fread(buf, 1, 20, f);
printf("r = %d\n", r);
r = fread(buf, 1, 20, f);
printf("r = %d\n", r);
return 0;
}
I compile with lcc-win:
d:\lcc\tmp>lc64 cz.c
d:\lcc\tmp>cz
r = 12
r = 0
d:\lcc\tmp>
You see? Using software that does NOT INTERPRET the data and produces an
EOF PROVES that windows, by itself, does NOT USE CTRL-Z as eof
terminator and that you can without any problems read a file containing
cotrl z beyond that character!
The TYPE utility has been written using the Microsoft runtime. As many
other programs. But that is a problem of THAT SPECIFIC RUNTIME and NOT
of windows as an OS.
Note that mingw/gcc uses also microsoft runtime.
[toc] | [prev] | [next] | [standalone]
Page 2 of 9 — ← Prev page 1 [2] 3 4 5 6 7 8 9 Next page →
Back to top | Article view | comp.lang.c
csiph-web