Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

In theory, there is no difference between theory and practice. In practice, there is.


computers / comp.os.linux.misc / Re: Why No "fcopy()" in 'C' ?

SubjectAuthor
* Why No "fcopy()" in 'C' ?MSB
+* Re: Why No "fcopy()" in 'C' ?The Natural Philosopher
|`- Re: Why No "fcopy()" in 'C' ?MSB
+* Re: Why No "fcopy()" in 'C' ?Dan Espen
|`* Re: Why No "fcopy()" in 'C' ?MSB
| +- Re: Why No "fcopy()" in 'C' ?Dan Espen
| +* Re: Why No "fcopy()" in 'C' ?Carlos E.R.
| |`* Re: Why No "fcopy()" in 'C' ?MSB
| | `* Re: Why No "fcopy()" in 'C' ?The Natural Philosopher
| |  `* Re: Why No "fcopy()" in 'C' ?Carlos E.R.
| |   `* Re: Why No "fcopy()" in 'C' ?MSB
| |    `* Re: Why No "fcopy()" in 'C' ?Rich
| |     +- Re: Why No "fcopy()" in 'C' ?Carlos E.R.
| |     +- Re: Why No "fcopy()" in 'C' ?Tauno Voipio
| |     +- Re: Why No "fcopy()" in 'C' ?Richard Kettlewell
| |     `- Re: Why No "fcopy()" in 'C' ?The Natural Philosopher
| `* Re: Why No "fcopy()" in 'C' ?Rich
|  +- Re: Why No "fcopy()" in 'C' ?Richard Kettlewell
|  `* Re: Why No "fcopy()" in 'C' ?MSB
|   +* Re: Why No "fcopy()" in 'C' ?The Natural Philosopher
|   |+- Re: Why No "fcopy()" in 'C' ?Richard Kettlewell
|   |+* Re: Why No "fcopy()" in 'C' ?Lew Pitcher
|   ||`* Re: Why No "fcopy()" in 'C' ?Lew Pitcher
|   || `- Re: Why No "fcopy()" in 'C' ?MSB
|   |`* Re: Why No "fcopy()" in 'C' ?MSB
|   | `* Re: Why No "fcopy()" in 'C' ?Aragorn
|   |  `* Re: Why No "fcopy()" in 'C' ?MSB
|   |   `- Re: Why No "fcopy()" in 'C' ?John-Paul Stewart
|   +* Re: Why No "fcopy()" in 'C' ?Rich
|   |`* Re: Why No "fcopy()" in 'C' ?MSB
|   | +- Re: Why No "fcopy()" in 'C' ?Robert Latest
|   | `* Re: Why No "fcopy()" in 'C' ?Lew Pitcher
|   |  `* Re: Why No "fcopy()" in 'C' ?Rich
|   |   `* Re: Why No "fcopy()" in 'C' ?MSB
|   |    +* Re: Why No "fcopy()" in 'C' ?The Natural Philosopher
|   |    |`* Re: Why No "fcopy()" in 'C' ?MSB
|   |    | `- Re: Why No "fcopy()" in 'C' ?The Natural Philosopher
|   |    `- Re: Why No "fcopy()" in 'C' ?Rich
|   `* Re: Why No "fcopy()" in 'C' ?Robert Latest
|    `- Re: Why No "fcopy()" in 'C' ?Richard Kettlewell
+* Re: Why No "fcopy()" in 'C' ?asdf
|+* Re: Why No "fcopy()" in 'C' ?MSB
||+* Re: Why No "fcopy()" in 'C' ?Robert Riches
|||`* Re: Why No "fcopy()" in 'C' ?MSB
||| `* Re: Why No "fcopy()" in 'C' ?Rich
|||  +* Re: Why No "fcopy()" in 'C' ?Richard Kettlewell
|||  |`* Re: Why No "fcopy()" in 'C' ?Rich
|||  | `* Re: Why No "fcopy()" in 'C' ?Richard Kettlewell
|||  |  `* Re: Why No "fcopy()" in 'C' ?MSB
|||  |   `* Re: Why No "fcopy()" in 'C' ?Richard Kettlewell
|||  |    `* Re: Why No "fcopy()" in 'C' ?MSB
|||  |     `* Re: Why No "fcopy()" in 'C' ?Richard Kettlewell
|||  |      +- Re: Why No "fcopy()" in 'C' ?Rich
|||  |      `* Re: Why No "fcopy()" in 'C' ?MSB
|||  |       +- Re: Why No "fcopy()" in 'C' ?Richard Kettlewell
|||  |       `* Re: Why No "fcopy()" in 'C' ?Giovanni
|||  |        `- Re: Why No "fcopy()" in 'C' ?MSB
|||  `* Re: Why No "fcopy()" in 'C' ?Eli the Bearded
|||   `- Re: Why No "fcopy()" in 'C' ?MSB
||`* Re: Why No "fcopy()" in 'C' ?Lew Pitcher
|| `- Re: Why No "fcopy()" in 'C' ?MSB
|`- Re: Why No "fcopy()" in 'C' ?The Natural Philosopher
`* Re: Why No "fcopy()" in 'C' ?Lew Pitcher
 `* Re: Why No "fcopy()" in 'C' ?Lew Pitcher
  `* Re: Why No "fcopy()" in 'C' ?Lew Pitcher
   `* Re: Why No "fcopy()" in 'C' ?Robert Heller
    `* Re: Why No "fcopy()" in 'C' ?Lew Pitcher
     `* Re: Why No "fcopy()" in 'C' ?Robert Heller
      `* Re: Why No "fcopy()" in 'C' ?Robert Riches
       `* Re: Why No "fcopy()" in 'C' ?MSB
        +* Re: Why No "fcopy()" in 'C' ?Rich
        |+- Re: Why No "fcopy()" in 'C' ?Eli the Bearded
        |`* Re: Why No "fcopy()" in 'C' ?MSB
        | `* Re: Why No "fcopy()" in 'C' ?Rich
        |  `- Re: Why No "fcopy()" in 'C' ?MSB
        `* Re: Why No "fcopy()" in 'C' ?Robert Latest
         +* Re: Why No "fcopy()" in 'C' ?Tauno Voipio
         |`* Re: Why No "fcopy()" in 'C' ?MSB
         | +- Re: Why No "fcopy()" in 'C' ?Rich
         | +* Re: Why No "fcopy()" in 'C' ?Giovanni
         | |`- Re: Why No "fcopy()" in 'C' ?MSB
         | `* Re: Why No "fcopy()" in 'C' ?Tauno Voipio
         |  +* Re: Why No "fcopy()" in 'C' ?Robert Riches
         |  |+- Re: Why No "fcopy()" in 'C' ?MSB
         |  |`- Re: Why No "fcopy()" in 'C' ?Tauno Voipio
         |  `* Re: Why No "fcopy()" in 'C' ?MSB
         |   `* Re: Why No "fcopy()" in 'C' ?Rich
         |    `* Re: Why No "fcopy()" in 'C' ?MSB
         |     `* Re: Why No "fcopy()" in 'C' ?Rich
         |      +* Re: Why No "fcopy()" in 'C' ?John-Paul Stewart
         |      |`- Re: Why No "fcopy()" in 'C' ?MSB
         |      `* Re: Why No "fcopy()" in 'C' ?MSB
         |       `- Re: Why No "fcopy()" in 'C' ?Rich
         `- Re: Why No "fcopy()" in 'C' ?MSB

Pages:1234
Re: Why No "fcopy()" in 'C' ?

<s7em4j$dcr$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4969&group=comp.os.linux.misc#4969

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 19:32:35 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 24
Message-ID: <s7em4j$dcr$2@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
<s7bfd1$v8q$1@dont-email.me> <tt2k9gd0j7ua3trhe9n3qnhellm9ovfdun@4ax.com>
<s7dapk$obm$3@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 11 May 2021 19:32:35 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="236b848e3227806415e265b88fc6da95";
logging-data="13723"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Km8TdJDZL1MjZaqtG00VnoUascdshZhs="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:HE2HhKpx9w2sXsvbRjdvE8xgp8M=
 by: Lew Pitcher - Tue, 11 May 2021 19:32 UTC

On Tue, 11 May 2021 08:12:52 +0100, The Natural Philosopher wrote:

> On 11/05/2021 06:05, MSB wrote:
>> 'C' is super-widely ported - microcontrollers on up. Unix is
>> merely ONE port of call. Really was barely even a Unix when
>> 'C' was invented - much less with "B". T
>
> Err, Unix was written in C, so there couldn't have been a Unix before C....

Err... Unix was /originally/ written in GECOS on a GE (later Honeywell) 635
system (https://www.bell-labs.com/usr/dmr/www/hist.html)

Later, once this seminal Unix had become self-sustaining (with the port of
the Assembler), the Bell Labs team (Kernighan, Ritchie, et al) created the
Unix implementation of the C language from it's B and BCPL roots, then
/re-implemented/ Unix with C (See "The C Progrmming Language" Brian W. Kernighan
& Dennis M. Ritchie, 1978, Preface: "C was originally designed for and implemented
on the UNIX operating system on the DEC PDP-11, by Dennis Ritchie")

So, you see, there most definitely /was/ a UNIX before C.

--
Lew Pitcher
"In Skills, We Trust"

Re: Why No "fcopy()" in 'C' ?

<s7en7k$dcr$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4970&group=comp.os.linux.misc#4970

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 19:51:16 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 58
Message-ID: <s7en7k$dcr$3@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s7eldp$dcr$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 11 May 2021 19:51:16 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="236b848e3227806415e265b88fc6da95";
logging-data="13723"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RYX7ZXzYPkFT2iavlZ/jqpygzBnBOvww="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:ElUnBwRtYqTEIKMjCOc3sN64cCo=
 by: Lew Pitcher - Tue, 11 May 2021 19:51 UTC

On Tue, 11 May 2021 19:20:26 +0000, Lew Pitcher wrote:

> On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:
>
>> "C" has been around almost forever - I bought the K&R book
>> when it was new on the shelves WAY back when.
>>
>> We have all sorts of handy string functions and a zillion
>> other neat-o things in the various libraries - but no fcopy().
>> It seems so basic.
>
> A verbatum file COPY function is easy enough to write, and of
> limited use in most programs. It's not so "basic" a function that
> it qualifies for inclusion in one of the standard libraries, although
> you can probably find it implemented in /someone's/ library.
>
>> Admittedly, it's not hard to write one - a "makedirs()"+
>> source&dest files (and better xfer all the stat() stuff) -
>> but, I guess it's a historical question, why was one never
>> included in stdio.h or a near relative ?
>
>
> Probably because Linux provides the POSIX-standard link(2)
> and symlink(2) system calls instead. And, Linux /also/ provides
> the sendfile(2) system call that automagically copies files (albeit,
> after some requisite application program preparation).

A trivial file copy program that uses sendfile(2):

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sendfile.h>

int main(int argc, char *argv[])
{
int in_fd, out_fd;
struct stat in_stat;

if (argc != 3) return EXIT_FAILURE; /* missing filenames */
if ((in_fd = open(argv[1],O_RDONLY)) == -1) return EXIT_FAILURE; /* cant open input file */
if (fstat(in_fd,&in_stat)) return EXIT_FAILURE; /* cant stat input file */
if ((out_fd = creat(argv[2],0666)) == -1) return EXIT_FAILURE; /* cant create output file */

sendfile(out_fd,in_fd,NULL,in_stat.st_size); /* the OP's fcopy() function...ish */

close(out_fd);
close(in_fd);
return EXIT_SUCCESS;
}

--
Lew Pitcher
"In Skills, We Trust"

Re: Why No "fcopy()" in 'C' ?

<s7eo0f$dcr$4@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4971&group=comp.os.linux.misc#4971

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 20:04:31 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 13
Message-ID: <s7eo0f$dcr$4@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s79kuo$19bd$1@gioia.aioe.org>
<ageh9g1dnfltim7qnad5io4vmnhq7rjjab@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 11 May 2021 20:04:31 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="236b848e3227806415e265b88fc6da95";
logging-data="13723"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18AqDbSsSvkXT1Q3L6gkbOSE0Omni8oeoY="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:1ia8q2idMRvMVWNh5FW/EUhzAUc=
 by: Lew Pitcher - Tue, 11 May 2021 20:04 UTC

On Mon, 10 May 2021 00:48:21 -0400, MSB wrote:

> Are K or R still alive ? Maybe we can ask.

Ken Thompson (the designer and original implementor of Unix) is still alive,
as is Brian Kernighan. Dennis Ritchie (the designer of the C language, and
implementor of Unix-written-in-C), sadly, passed away in 2011.

--
Lew Pitcher
"In Skills, We Trust"

Re: Why No "fcopy()" in 'C' ?

<s7eo6l$dcr$5@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4972&group=comp.os.linux.misc#4972

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 20:07:49 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 45
Message-ID: <s7eo6l$dcr$5@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s7eldp$dcr$1@dont-email.me> <s7en7k$dcr$3@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 11 May 2021 20:07:49 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="236b848e3227806415e265b88fc6da95";
logging-data="13723"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18TMBomx9c3iE8gAhMJxpDJL44FY4cedaY="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:L/zuAUpD5bwESWwSmZZKhrXL0pw=
 by: Lew Pitcher - Tue, 11 May 2021 20:07 UTC

On Tue, 11 May 2021 19:51:16 +0000, Lew Pitcher wrote:

> On Tue, 11 May 2021 19:20:26 +0000, Lew Pitcher wrote:
>
>> On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:
>>
>>> "C" has been around almost forever - I bought the K&R book
>>> when it was new on the shelves WAY back when.
>>>
>>> We have all sorts of handy string functions and a zillion
>>> other neat-o things in the various libraries - but no fcopy().
>>> It seems so basic.
>>
>> A verbatum file COPY function is easy enough to write, and of
>> limited use in most programs. It's not so "basic" a function that
>> it qualifies for inclusion in one of the standard libraries, although
>> you can probably find it implemented in /someone's/ library.
>>
>>> Admittedly, it's not hard to write one - a "makedirs()"+
>>> source&dest files (and better xfer all the stat() stuff) -
>>> but, I guess it's a historical question, why was one never
>>> included in stdio.h or a near relative ?
>>
>>
>> Probably because Linux provides the POSIX-standard link(2)
>> and symlink(2) system calls instead. And, Linux /also/ provides
>> the sendfile(2) system call that automagically copies files (albeit,
>> after some requisite application program preparation).
>
> A trivial file copy program that uses sendfile(2):
[snip]

/The/ trivial file copy program from K&R v1 ("The C Programming Language", 1978)

main() /* copy input to output; 2nd version */
{
int c;
while ((c = getchar()) != EOF)
putchar(c);
}

--
Lew Pitcher
"In Skills, We Trust"

Re: Why No "fcopy()" in 'C' ?

<z46dncKcx8LKbQf9nZ2dnUU78SvNnZ2d@giganews.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4973&group=comp.os.linux.misc#4973

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 11 May 2021 16:00:06 -0500
MIME-Version: 1.0
From: hel...@deepsoft.com (Robert Heller)
Organization: Deepwoods Software
X-Newsreader: TkNews 3.0 (1.2.12)
Subject: Re: Why No "fcopy()" in 'C' ?
In-Reply-To: <s7eo6l$dcr$5@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>??<s7eldp$dcr$1@dont-email.me>
<s7en7k$dcr$3@dont-email.me> <s7eo6l$dcr$5@dont-email.me>
Newsgroups: comp.os.linux.misc
Content-Type: text/plain;
charset="us-ascii"
Originator: heller@sharky4.deepsoft.com
Message-ID: <z46dncKcx8LKbQf9nZ2dnUU78SvNnZ2d@giganews.com>
Date: Tue, 11 May 2021 16:00:07 -0500
Lines: 55
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-dBWDOKpKR/FLy+wxgGB7k7Mnd6Or0M43zVOE8r+pNbNtVwBQD+DYNMlxCRpAObBasvPRgPTAsOyQw7t!3LnF7TWucv6gqKuqAr1LoTm4LIA9NKIYTAXMAvaUkglPuJ4uuaCXRHIJ/jPbZ2ThHIznN5/VenSP!oWc=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3278
 by: Robert Heller - Tue, 11 May 2021 21:00 UTC

At Tue, 11 May 2021 20:07:49 -0000 (UTC) Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:

>
> On Tue, 11 May 2021 19:51:16 +0000, Lew Pitcher wrote:
>
> > On Tue, 11 May 2021 19:20:26 +0000, Lew Pitcher wrote:
> >
> >> On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:
> >>
> >>> "C" has been around almost forever - I bought the K&R book
> >>> when it was new on the shelves WAY back when.
> >>>
> >>> We have all sorts of handy string functions and a zillion
> >>> other neat-o things in the various libraries - but no fcopy().
> >>> It seems so basic.
> >>
> >> A verbatum file COPY function is easy enough to write, and of
> >> limited use in most programs. It's not so "basic" a function that
> >> it qualifies for inclusion in one of the standard libraries, although
> >> you can probably find it implemented in /someone's/ library.
> >>
> >>> Admittedly, it's not hard to write one - a "makedirs()"+
> >>> source&dest files (and better xfer all the stat() stuff) -
> >>> but, I guess it's a historical question, why was one never
> >>> included in stdio.h or a near relative ?
> >>
> >>
> >> Probably because Linux provides the POSIX-standard link(2)
> >> and symlink(2) system calls instead. And, Linux /also/ provides
> >> the sendfile(2) system call that automagically copies files (albeit,
> >> after some requisite application program preparation).
> >
> > A trivial file copy program that uses sendfile(2):
> [snip]
>
> /The/ trivial file copy program from K&R v1 ("The C Programming Language", 1978)
>
> main() /* copy input to output; 2nd version */
> {
> int c;
> while ((c = getchar()) != EOF)
> putchar(c);
> }

Ha. stdin to stdout, one byte at a time.... Probably very slow...

>
>

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller@deepsoft.com -- Webhosting Services

Re: Why No "fcopy()" in 'C' ?

<s7es2c$lur$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4974&group=comp.os.linux.misc#4974

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 21:13:48 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 33
Message-ID: <s7es2c$lur$1@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
<s7bfd1$v8q$1@dont-email.me> <tt2k9gd0j7ua3trhe9n3qnhellm9ovfdun@4ax.com>
<s7dapk$obm$3@dont-email.me> <s7em4j$dcr$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 11 May 2021 21:13:48 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="236b848e3227806415e265b88fc6da95";
logging-data="22491"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Q+Hm8lWilVCzPRKh1hlAzIERzcALKO70="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:ZL6fv3hYkG+PQaLcqEUaWUqqw6c=
 by: Lew Pitcher - Tue, 11 May 2021 21:13 UTC

Correction.....

On Tue, 11 May 2021 19:32:35 +0000, Lew Pitcher wrote:

> On Tue, 11 May 2021 08:12:52 +0100, The Natural Philosopher wrote:
>
>> On 11/05/2021 06:05, MSB wrote:
>>> 'C' is super-widely ported - microcontrollers on up. Unix is
>>> merely ONE port of call. Really was barely even a Unix when
>>> 'C' was invented - much less with "B". T
>>
>> Err, Unix was written in C, so there couldn't have been a Unix before C....
>
> Err... Unix was /originally/ written in
PDP-7 assembly language, cross-assembled in
> GECOS on a GE (later Honeywell) 635
> system (https://www.bell-labs.com/usr/dmr/www/hist.html)
>
> Later, once this seminal Unix had become self-sustaining (with the port of
> the Assembler), the Bell Labs team (Kernighan, Ritchie, et al) created the
> Unix implementation of the C language from it's B and BCPL roots, then
> /re-implemented/ Unix with C (See "The C Progrmming Language" Brian W. Kernighan
> & Dennis M. Ritchie, 1978, Preface: "C was originally designed for and implemented
> on the UNIX operating system on the DEC PDP-11, by Dennis Ritchie")
>
> So, you see, there most definitely /was/ a UNIX before C.

--
Lew Pitcher
"In Skills, We Trust"

Re: Why No "fcopy()" in 'C' ?

<s7essd$lur$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4975&group=comp.os.linux.misc#4975

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 21:27:41 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 60
Message-ID: <s7essd$lur$2@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s7eldp$dcr$1@dont-email.me> <s7en7k$dcr$3@dont-email.me>
<s7eo6l$dcr$5@dont-email.me>
<z46dncKcx8LKbQf9nZ2dnUU78SvNnZ2d@giganews.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 11 May 2021 21:27:41 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="236b848e3227806415e265b88fc6da95";
logging-data="22491"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Q9uH+jF9/Q89+7kQC5yJjCgDRAkAyOYE="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:aYtNqbdD+AyW1qaGzW0sMDzzU5k=
 by: Lew Pitcher - Tue, 11 May 2021 21:27 UTC

On Tue, 11 May 2021 16:00:07 -0500, Robert Heller wrote:

> At Tue, 11 May 2021 20:07:49 -0000 (UTC) Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>
>>
>> On Tue, 11 May 2021 19:51:16 +0000, Lew Pitcher wrote:
>>
>> > On Tue, 11 May 2021 19:20:26 +0000, Lew Pitcher wrote:
>> >
>> >> On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:
>> >>
>> >>> "C" has been around almost forever - I bought the K&R book
>> >>> when it was new on the shelves WAY back when.
>> >>>
>> >>> We have all sorts of handy string functions and a zillion
>> >>> other neat-o things in the various libraries - but no fcopy().
>> >>> It seems so basic.
>> >>
>> >> A verbatum file COPY function is easy enough to write, and of
>> >> limited use in most programs. It's not so "basic" a function that
>> >> it qualifies for inclusion in one of the standard libraries, although
>> >> you can probably find it implemented in /someone's/ library.
>> >>
>> >>> Admittedly, it's not hard to write one - a "makedirs()"+
>> >>> source&dest files (and better xfer all the stat() stuff) -
>> >>> but, I guess it's a historical question, why was one never
>> >>> included in stdio.h or a near relative ?
>> >>
>> >>
>> >> Probably because Linux provides the POSIX-standard link(2)
>> >> and symlink(2) system calls instead. And, Linux /also/ provides
>> >> the sendfile(2) system call that automagically copies files (albeit,
>> >> after some requisite application program preparation).
>> >
>> > A trivial file copy program that uses sendfile(2):
>> [snip]
>>
>> /The/ trivial file copy program from K&R v1 ("The C Programming Language", 1978)
>>
>> main() /* copy input to output; 2nd version */
>> {
>> int c;
>> while ((c = getchar()) != EOF)
>> putchar(c);
>> }
>
> Ha. stdin to stdout, one byte at a time.... Probably very slow...

Probably not as slow as you think.

Yes, byte-at-a-time transfer from kernel buffer to program space,
followed by byte-at-a-time from program space to kernel buffer would
have taken a bit of time (compared to kernel-buffer I/O), but the
kernel would have spent much more time waiting for it's block I/O to
complete than would have been taken by kernel to application to kernel
data transfer.

--
Lew Pitcher
"In Skills, We Trust"

Re: Why No "fcopy()" in 'C' ?

<yYedncTUQJMEkgb9nZ2dnUU7-a_NnZ2d@giganews.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4976&group=comp.os.linux.misc#4976

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 11 May 2021 18:13:29 -0500
MIME-Version: 1.0
From: hel...@deepsoft.com (Robert Heller)
Organization: Deepwoods Software
X-Newsreader: TkNews 3.0 (1.2.12)
Subject: Re: Why No "fcopy()" in 'C' ?
In-Reply-To: <s7essd$lur$2@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>??<s7eldp$dcr$1@dont-email.me> <s7en7k$dcr$3@dont-email.me>??<s7eo6l$dcr$5@dont-email.me>??<z46dncKcx8LKbQf9nZ2dnUU78SvNnZ2d@giganews.com> <s7essd$lur$2@dont-email.me>
Newsgroups: comp.os.linux.misc
Content-Type: text/plain; charset="us-ascii"
Originator: heller@sharky4.deepsoft.com
Message-ID: <yYedncTUQJMEkgb9nZ2dnUU7-a_NnZ2d@giganews.com>
Date: Tue, 11 May 2021 18:13:29 -0500
Lines: 71
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-kaSwP1q3ZTFbo6avyguXjmZuxpk2B7o1E4b7ejHiSkLUidXlu6pvDYgr896ihyZbHTTLXgN2NkJinpr!q9IcE+XaakHlbDKFVIJ9X8IYbK6fciumvX8Or1QdwxbwgOF7gDgZ1sgF1be6tjUYMYNAcvlqFwA4!MGw=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 4191
 by: Robert Heller - Tue, 11 May 2021 23:13 UTC

At Tue, 11 May 2021 21:27:41 -0000 (UTC) Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:

>
> On Tue, 11 May 2021 16:00:07 -0500, Robert Heller wrote:
>
> > At Tue, 11 May 2021 20:07:49 -0000 (UTC) Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
> >
> >>
> >> On Tue, 11 May 2021 19:51:16 +0000, Lew Pitcher wrote:
> >>
> >> > On Tue, 11 May 2021 19:20:26 +0000, Lew Pitcher wrote:
> >> >
> >> >> On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:
> >> >>
> >> >>> "C" has been around almost forever - I bought the K&R book
> >> >>> when it was new on the shelves WAY back when.
> >> >>>
> >> >>> We have all sorts of handy string functions and a zillion
> >> >>> other neat-o things in the various libraries - but no fcopy().
> >> >>> It seems so basic.
> >> >>
> >> >> A verbatum file COPY function is easy enough to write, and of
> >> >> limited use in most programs. It's not so "basic" a function that
> >> >> it qualifies for inclusion in one of the standard libraries, although
> >> >> you can probably find it implemented in /someone's/ library.
> >> >>
> >> >>> Admittedly, it's not hard to write one - a "makedirs()"+
> >> >>> source&dest files (and better xfer all the stat() stuff) -
> >> >>> but, I guess it's a historical question, why was one never
> >> >>> included in stdio.h or a near relative ?
> >> >>
> >> >>
> >> >> Probably because Linux provides the POSIX-standard link(2)
> >> >> and symlink(2) system calls instead. And, Linux /also/ provides
> >> >> the sendfile(2) system call that automagically copies files (albeit,
> >> >> after some requisite application program preparation).
> >> >
> >> > A trivial file copy program that uses sendfile(2):
> >> [snip]
> >>
> >> /The/ trivial file copy program from K&R v1 ("The C Programming Language", 1978)
> >>
> >> main() /* copy input to output; 2nd version */
> >> {
> >> int c;
> >> while ((c = getchar()) != EOF)
> >> putchar(c);
> >> }
> >
> > Ha. stdin to stdout, one byte at a time.... Probably very slow...
>
> Probably not as slow as you think.
>
> Yes, byte-at-a-time transfer from kernel buffer to program space,
> followed by byte-at-a-time from program space to kernel buffer would
> have taken a bit of time (compared to kernel-buffer I/O), but the
> kernel would have spent much more time waiting for it's block I/O to
> complete than would have been taken by kernel to application to kernel
> data transfer.

I was think more in terms of function call overhead. But, yeah, probably not
really all that noticable...

>

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller@deepsoft.com -- Webhosting Services

Re: Why No "fcopy()" in 'C' ?

<slrns9mg94.rtj.spamtrap42@one.localnet>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4977&group=comp.os.linux.misc#4977

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: spamtra...@jacob21819.net (Robert Riches)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: 12 May 2021 02:44:52 GMT
Organization: none-at-all
Lines: 72
Message-ID: <slrns9mg94.rtj.spamtrap42@one.localnet>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s7eldp$dcr$1@dont-email.me> <s7en7k$dcr$3@dont-email.me>
<s7eo6l$dcr$5@dont-email.me>
<z46dncKcx8LKbQf9nZ2dnUU78SvNnZ2d@giganews.com>
<s7essd$lur$2@dont-email.me>
<yYedncTUQJMEkgb9nZ2dnUU7-a_NnZ2d@giganews.com>
Reply-To: spamtrap42@jacob21819.net
X-Trace: individual.net 5lm1md3XAK+A1fkDSJhXlgLtYUQwNJ3Wi6u5CdZavYd1sXKz55
Cancel-Lock: sha1:G3Vn7fSAaF1blqfi6chXv7JeyLA=
User-Agent: slrn/1.0.3 (Linux)
 by: Robert Riches - Wed, 12 May 2021 02:44 UTC

On 2021-05-11, Robert Heller <heller@deepsoft.com> wrote:
> At Tue, 11 May 2021 21:27:41 -0000 (UTC) Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>
>>
>> On Tue, 11 May 2021 16:00:07 -0500, Robert Heller wrote:
>>
>> > At Tue, 11 May 2021 20:07:49 -0000 (UTC) Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>> >
>> >>
>> >> On Tue, 11 May 2021 19:51:16 +0000, Lew Pitcher wrote:
>> >>
>> >> > On Tue, 11 May 2021 19:20:26 +0000, Lew Pitcher wrote:
>> >> >
>> >> >> On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:
>> >> >>
>> >> >>> "C" has been around almost forever - I bought the K&R book
>> >> >>> when it was new on the shelves WAY back when.
>> >> >>>
>> >> >>> We have all sorts of handy string functions and a zillion
>> >> >>> other neat-o things in the various libraries - but no fcopy().
>> >> >>> It seems so basic.
>> >> >>
>> >> >> A verbatum file COPY function is easy enough to write, and of
>> >> >> limited use in most programs. It's not so "basic" a function that
>> >> >> it qualifies for inclusion in one of the standard libraries, although
>> >> >> you can probably find it implemented in /someone's/ library.
>> >> >>
>> >> >>> Admittedly, it's not hard to write one - a "makedirs()"+
>> >> >>> source&dest files (and better xfer all the stat() stuff) -
>> >> >>> but, I guess it's a historical question, why was one never
>> >> >>> included in stdio.h or a near relative ?
>> >> >>
>> >> >>
>> >> >> Probably because Linux provides the POSIX-standard link(2)
>> >> >> and symlink(2) system calls instead. And, Linux /also/ provides
>> >> >> the sendfile(2) system call that automagically copies files (albeit,
>> >> >> after some requisite application program preparation).
>> >> >
>> >> > A trivial file copy program that uses sendfile(2):
>> >> [snip]
>> >>
>> >> /The/ trivial file copy program from K&R v1 ("The C Programming Language", 1978)
>> >>
>> >> main() /* copy input to output; 2nd version */
>> >> {
>> >> int c;
>> >> while ((c = getchar()) != EOF)
>> >> putchar(c);
>> >> }
>> >
>> > Ha. stdin to stdout, one byte at a time.... Probably very slow...
>>
>> Probably not as slow as you think.
>>
>> Yes, byte-at-a-time transfer from kernel buffer to program space,
>> followed by byte-at-a-time from program space to kernel buffer would
>> have taken a bit of time (compared to kernel-buffer I/O), but the
>> kernel would have spent much more time waiting for it's block I/O to
>> complete than would have been taken by kernel to application to kernel
>> data transfer.
>
> I was think more in terms of function call overhead. But, yeah, probably not
> really all that noticable...

In at least some cases, putc(), getc(), putchar(), and getchar()
were macros--according to K&R's "The C Programming Language" with
a 1978 copyright date.

--
Robert Riches
spamtrap42@jacob21819.net
(Yes, that is one of my email addresses.)

Re: Why No "fcopy()" in 'C' ?

<fphm9glb0f5nrc4klhmcrsjode1e9vluqd@4ax.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4978&group=comp.os.linux.misc#4978

  copy link   Newsgroups: comp.os.linux.misc
X-Received: by 2002:a05:600c:2f17:: with SMTP id r23mr8849701wmn.28.1620789502400;
Tue, 11 May 2021 20:18:22 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.niel.me!news.gegeweb.eu!gegeweb.org!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 11 May 2021 22:18:17 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 23:18:17 -0400
Message-ID: <fphm9glb0f5nrc4klhmcrsjode1e9vluqd@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com> <s7bfd1$v8q$1@dont-email.me> <tt2k9gd0j7ua3trhe9n3qnhellm9ovfdun@4ax.com> <s7dapk$obm$3@dont-email.me>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Lines: 17
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-wLw0HtTd8FyQCxtoVpGt1+bUaoMYgPnoZdWfsIRO8YXSm/DjnEYlFZ/GTZTDKZx7uC/XJYw9bUpUuKe!RE61bc9HCh6QAJT8QaOttntcRqTJV7vdxJEXN5k3Cv7bf9EuctwQGHMpylFsMjEhNWeVWuUkOg2Y!ZkfpdH+YAogUFY0=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1815
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
 by: MSB - Wed, 12 May 2021 03:18 UTC

On Tue, 11 May 2021 08:12:52 +0100, The Natural Philosopher
<tnp@invalid.invalid> wrote:

>On 11/05/2021 06:05, MSB wrote:
>> 'C' is super-widely ported - microcontrollers on up. Unix is
>> merely ONE port of call. Really was barely even a Unix when
>> 'C' was invented - much less with "B". T
>
>Err, Unix was written in C, so there couldn't have been a Unix before C....

Nor a "C" before Unix ? :-)

Unix CAME to be written mostly in 'C' because, well, it
was good for the job. It's origins however were rather
more diverse. They were SELLING it after all - and the
rule is "function first, form later".

Re: Why No "fcopy()" in 'C' ?

<20210512053317.5969b9d7@nx-74205>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4979&group=comp.os.linux.misc#4979

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: thoron...@telenet.be (Aragorn)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 12 May 2021 05:33:17 +0200
Organization: A noiseless patient Strider
Lines: 37
Message-ID: <20210512053317.5969b9d7@nx-74205>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me>
<i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
<s7bfd1$v8q$1@dont-email.me>
<tt2k9gd0j7ua3trhe9n3qnhellm9ovfdun@4ax.com>
<s7dapk$obm$3@dont-email.me>
<fphm9glb0f5nrc4klhmcrsjode1e9vluqd@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: reader02.eternal-september.org; posting-host="6ebc7ad5027929242805cc7c41a11f67";
logging-data="28368"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18643kIlr5AUu01oGZ9TTK0"
Cancel-Lock: sha1:WGyUBIQshX8rK+6XlustXVdDBjQ=
X-Newsreader: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
 by: Aragorn - Wed, 12 May 2021 03:33 UTC

On 11.05.2021 at 23:18, MSB scribbled:

> On Tue, 11 May 2021 08:12:52 +0100, The Natural Philosopher
> <tnp@invalid.invalid> wrote:
>
> >On 11/05/2021 06:05, MSB wrote:
> >> 'C' is super-widely ported - microcontrollers on up. Unix is
> >> merely ONE port of call. Really was barely even a Unix when
> >> 'C' was invented - much less with "B". T
> >
> >Err, Unix was written in C, so there couldn't have been a Unix
> >before C....
>
> Nor a "C" before Unix ? :-)
>
> Unix CAME to be written mostly in 'C' because, well, it
> was good for the job. It's origins however were rather
> more diverse. They were SELLING it after all - and the
> rule is "function first, form later".

The original Unix was written in assembler on an until then unused
PDP-7 sitting in a corner at AT&T Bell Labs in 1969. Dennis Ritchie
created the C language — as a compiled and improved successor to Ken
Thompson's interpreted B language — in 1973. It was only at that time
that Unix was rewritten in C so as to make it portable, and this was on
a PDP-11.

In addition to this, AT&T Bell Labs could not sell/market Unix at the
time due to an antitrust ruling, and they were obligated to license the
source code to whoever requested it. That's how BSD got involved.

--
With respect,
= Aragorn

Re: Why No "fcopy()" in 'C' ?

<haim9g1ircm44c537m6qu93fsqrgdp152m@4ax.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4980&group=comp.os.linux.misc#4980

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 11 May 2021 22:49:06 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 23:49:05 -0400
Message-ID: <haim9g1ircm44c537m6qu93fsqrgdp152m@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com> <s7bfd1$v8q$1@dont-email.me> <tt2k9gd0j7ua3trhe9n3qnhellm9ovfdun@4ax.com> <s7drhh$l8j$1@dont-email.me>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 94
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-OcmiV9R9dzXjqkWiZ/26EP5J8waE0+RuXZY4P93dNWZubrudNtE4wiIDSqb70o0I09wCcfUEIK80YNK!6kNhQYmkDNv6ex/wIvY6tTaP1cB7WucLpyhONn8HHyYDt/rKVPB2YZNTHfisX93WaPcwauoTgtUN!Ncivef2U4l6KVBk=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 5652
 by: MSB - Wed, 12 May 2021 03:49 UTC

On Tue, 11 May 2021 11:58:41 -0000 (UTC), Rich <rich@example.invalid>
wrote:

>MSB <Bit15_.us> wrote:
>>>> so why not fcopy() ???
>>>
>>>There is no "fcopy" syscall. So no 'fcopy' in libc.
>>
>> In Linux/Unix it's a "cp" or "mv" syscall. Didn't do
>> everything I wanted.
>
>cp and mv are not syscalls. They are executables that you can use the
>C system() function to execute.
>
>syscalls are the actual function entry points provided by the kernel.

Technically true. However you won't find a terminal emulator
without 'cp' in some form or another. If not stricty 'kernel' it
is still a core function. NO sort of OS/system is going to be
without a handy fcopy()-like command.

>>>Most of the basic C libaries are more-or-less simply C level
>>>interfaces to the various Unix syscalls. As there is no "fcopy"
>>>syscall, there is no fcopy() function in the basic C libraries.
>>
>> 'C' is super-widely ported - microcontrollers on up. Unix is merely
>> ONE port of call. Really was barely even a Unix when 'C' was
>> invented - much less with "B".
>
>Nope, you've got your history all wrong there. Unix came first. C was
>invented to rewrite Unix from PDP assembly into a high level language
>for porting Unix to another variant of the PDP series.

Correct. First there was Unix (v0.x) which was a concept, but
one kind of cobbled-together in a variety of ways. When 'C'
arrived, got good, they realized it was just ideal to re-write
all the junky bits in 'C'. It was better than assembly which
would have to be ported between diverse archetectures.
Just port 'C' and recompile your UNIX system.

>
>https://en.wikipedia.org/wiki/C_(programming_language)
>
> A successor to the programming language B, C was originally
> developed at Bell Labs by Dennis Ritchie between 1972 and 1973 to
> construct utilities running on Unix. It was applied to
> re-implementing the kernel of the Unix operating system.

'B' does not look a lot like 'C' superficially. However it WAS
still better than the abovementioned custom assember for
every box. Fortunately, Ritchie got inspired .... cut and buffed
the raw diamond hidden in 'B'. Fifty years later it's STILL
What You Use to write decent kernels and all the core
utilities. Will be for a few more decades very likely. AI
type systems will eventually require 'C' to be displaced,
the 'OS' writ in and by the AI "language" sort of like PICK-OS
came to be writ in PICK.

> ...
>
> The origin of C is closely tied to the development of the Unix
> operating system, originally implemented in assembly language on a
> PDP-7 by Dennis Ritchie and Ken Thompson, incorporating several
> ideas from colleagues. Eventually, they decided to port the
> operating system to a PDP-11. The original PDP-11 version of Unix
> was also developed in assembly language.[6]
>
> Thompson desired a programming language to make utilities for the
> new platform. At first, he tried to make a Fortran compiler, but
> soon gave up the idea. Instead, he created a cut-down version of
> the recently developed BCPL systems programming language. The
> official description of BCPL was not available at the time,[11] and
> Thompson modified the syntax to be less wordy, producing the
> similar but somewhat simpler B.[6] However, few utilities were
> ultimately written in B because it was too slow, and B could not
> take advantage of PDP-11 features such as byte addressability.
>
> In 1972, Ritchie started to improve B, which resulted in creating a
> new language C.[12] The C compiler and some utilities made with it
> were included in Version 2 Unix.[13]
>
> At Version 4 Unix, released in November 1973, the Unix kernel was
> extensively re-implemented in C.[6] By this time, the C language
> had acquired some powerful features such as struct types.

I was looking at 'D' today .... SOME improvements over 'C'/CPP, but
also some annoyances. Is it worth it ?

I was also looking at Modula-2 ... did you know there are at least
three sets of libraries for it - ISO, PIM and LOGITECH, plus the
libraries GNU-GM2 put together ? What a mess. Could barely
figure out how to get anything more than "Hello World" to compile.
Somehow, I don't think I'd be tempted to write an OS in M-2.

Re: Why No "fcopy()" in 'C' ?

<b7km9ghfo32nqv93uknv3pf2hca8i1esot@4ax.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4981&group=comp.os.linux.misc#4981

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 11 May 2021 23:05:13 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 12 May 2021 00:05:13 -0400
Message-ID: <b7km9ghfo32nqv93uknv3pf2hca8i1esot@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com> <s7bfd1$v8q$1@dont-email.me> <tt2k9gd0j7ua3trhe9n3qnhellm9ovfdun@4ax.com> <s7dapk$obm$3@dont-email.me> <s7em4j$dcr$2@dont-email.me> <s7es2c$lur$1@dont-email.me>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 45
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-TcNO1iQGR7/vPtQVhtgLVQgEYrxXKbIQqTyDjCj4k2vlMO94/XfWbFo/aC3AZReQj9BcRQTR1Rk7GtK!251/w3dw06+nbZ+I5qLffCop7hlkbUJbnC+jnTQgQ9XGT35bYFj1J8CP3ESg7FbVTD4Y8WFIfiYC!etOEMbHyU0uZNHA=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3302
 by: MSB - Wed, 12 May 2021 04:05 UTC

On Tue, 11 May 2021 21:13:48 -0000 (UTC), Lew Pitcher
<lew.pitcher@digitalfreehold.ca> wrote:

>Correction.....
>
>On Tue, 11 May 2021 19:32:35 +0000, Lew Pitcher wrote:
>
>> On Tue, 11 May 2021 08:12:52 +0100, The Natural Philosopher wrote:
>>
>>> On 11/05/2021 06:05, MSB wrote:
>>>> 'C' is super-widely ported - microcontrollers on up. Unix is
>>>> merely ONE port of call. Really was barely even a Unix when
>>>> 'C' was invented - much less with "B". T
>>>
>>> Err, Unix was written in C, so there couldn't have been a Unix before C....
>>
>> Err... Unix was /originally/ written in
>PDP-7 assembly language, cross-assembled in
>> GECOS on a GE (later Honeywell) 635
>> system (https://www.bell-labs.com/usr/dmr/www/hist.html)
>>
>> Later, once this seminal Unix had become self-sustaining (with the port of
>> the Assembler), the Bell Labs team (Kernighan, Ritchie, et al) created the
>> Unix implementation of the C language from it's B and BCPL roots, then
>> /re-implemented/ Unix with C (See "The C Progrmming Language" Brian W. Kernighan
>> & Dennis M. Ritchie, 1978, Preface: "C was originally designed for and implemented
>> on the UNIX operating system on the DEC PDP-11, by Dennis Ritchie")
>>
>> So, you see, there most definitely /was/ a UNIX before C.

Some people these days have a rather "creationist" notion
of UNIX ... that the concept and impementation (and 'C')
just kind of sprang into existence in a burst of purple
magic smoke. All those things co-evolved over a number
of years. 'C' finally emerged as the best and obvious way
to write the kernel and core utilities - and still is - but when
UNIX started there was no 'C'. Desired FUNCTION first,
standardization and polish later.

VMS was another Damned Good OS and it *could* have
been the worlds UNIX. However DEC was a little too
aggressive about its intellectual property IMHO, and failed
to grasp the importance of giving universities the breaks
required in order to cultivate a larger future following.

Re: Why No "fcopy()" in 'C' ?

<rclm9g5p3fccssosr9228c9q84o2nbsduq@4ax.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4982&group=comp.os.linux.misc#4982

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 11 May 2021 23:35:02 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 12 May 2021 00:35:02 -0400
Message-ID: <rclm9g5p3fccssosr9228c9q84o2nbsduq@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s7eldp$dcr$1@dont-email.me> <s7en7k$dcr$3@dont-email.me> <s7eo6l$dcr$5@dont-email.me> <z46dncKcx8LKbQf9nZ2dnUU78SvNnZ2d@giganews.com> <s7essd$lur$2@dont-email.me> <yYedncTUQJMEkgb9nZ2dnUU7-a_NnZ2d@giganews.com> <slrns9mg94.rtj.spamtrap42@one.localnet>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 95
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-txWyfdwCuxE2lwaLs8LOnLQcDFDSdmW/eZdf3GhaHNxDP0axNCiwllGGl+TbDogvAVDCyVSL0nTxrcb!XhSL5uzbuZ5nYz+a5uq9JhKRSO1EiAA+6AgTfdcVVEtz/WdyRoNweyCB58eVMPMMgWhKATRC8iVl!KjYLLbpj6oM6SQM=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 5430
 by: MSB - Wed, 12 May 2021 04:35 UTC

On 12 May 2021 02:44:52 GMT, Robert Riches <spamtrap42@jacob21819.net>
wrote:

>On 2021-05-11, Robert Heller <heller@deepsoft.com> wrote:
>> At Tue, 11 May 2021 21:27:41 -0000 (UTC) Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>>
>>>
>>> On Tue, 11 May 2021 16:00:07 -0500, Robert Heller wrote:
>>>
>>> > At Tue, 11 May 2021 20:07:49 -0000 (UTC) Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>>> >
>>> >>
>>> >> On Tue, 11 May 2021 19:51:16 +0000, Lew Pitcher wrote:
>>> >>
>>> >> > On Tue, 11 May 2021 19:20:26 +0000, Lew Pitcher wrote:
>>> >> >
>>> >> >> On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:
>>> >> >>
>>> >> >>> "C" has been around almost forever - I bought the K&R book
>>> >> >>> when it was new on the shelves WAY back when.
>>> >> >>>
>>> >> >>> We have all sorts of handy string functions and a zillion
>>> >> >>> other neat-o things in the various libraries - but no fcopy().
>>> >> >>> It seems so basic.
>>> >> >>
>>> >> >> A verbatum file COPY function is easy enough to write, and of
>>> >> >> limited use in most programs. It's not so "basic" a function that
>>> >> >> it qualifies for inclusion in one of the standard libraries, although
>>> >> >> you can probably find it implemented in /someone's/ library.
>>> >> >>
>>> >> >>> Admittedly, it's not hard to write one - a "makedirs()"+
>>> >> >>> source&dest files (and better xfer all the stat() stuff) -
>>> >> >>> but, I guess it's a historical question, why was one never
>>> >> >>> included in stdio.h or a near relative ?
>>> >> >>
>>> >> >>
>>> >> >> Probably because Linux provides the POSIX-standard link(2)
>>> >> >> and symlink(2) system calls instead. And, Linux /also/ provides
>>> >> >> the sendfile(2) system call that automagically copies files (albeit,
>>> >> >> after some requisite application program preparation).
>>> >> >
>>> >> > A trivial file copy program that uses sendfile(2):
>>> >> [snip]
>>> >>
>>> >> /The/ trivial file copy program from K&R v1 ("The C Programming Language", 1978)
>>> >>
>>> >> main() /* copy input to output; 2nd version */
>>> >> {
>>> >> int c;
>>> >> while ((c = getchar()) != EOF)
>>> >> putchar(c);
>>> >> }
>>> >
>>> > Ha. stdin to stdout, one byte at a time.... Probably very slow...
>>>
>>> Probably not as slow as you think.
>>>
>>> Yes, byte-at-a-time transfer from kernel buffer to program space,
>>> followed by byte-at-a-time from program space to kernel buffer would
>>> have taken a bit of time (compared to kernel-buffer I/O), but the
>>> kernel would have spent much more time waiting for it's block I/O to
>>> complete than would have been taken by kernel to application to kernel
>>> data transfer.
>>
>> I was think more in terms of function call overhead. But, yeah, probably not
>> really all that noticable...
>
>In at least some cases, putc(), getc(), putchar(), and getchar()
>were macros--according to K&R's "The C Programming Language" with
>a 1978 copyright date.

I think they still are in some of the bargain-basement 'C'
implementations for microcontrollers. Still, something SO
basic and common, just write the damned function outright
and stuff it into a .h along with 100 other often-unused
functions ! At least it would be STANDARD.

Recently I re-invented the wheel yet again, writing an
fcopy(). I spent some time wondering whether to use
open/write/close -vs- fopen/fwrite/fclose. I shouldn't
have had to waste the time. They are NOT quite
the same ... fwrite() can sometimes try to "fix"
line endings - assuming you're writing text instead
of binary. I eventually settled on open/write/close
instead just because of that possibility. Just a dozen
lines - a few dedicated to immediate bail-out if the
caller screwed up and sent garbage params ( I like
to cover Stupid Users and send useful error codes
when they screw up).

Geez ... my little inquiry seems to have gotten out of
hand. I assumed there'd be somebody a bit before
my time who could clearly explain why no standard
fcopy() was in 'C'. Instead ............. :-)

Re: Why No "fcopy()" in 'C' ?

<n8nm9g5dfl6ngctfsbvlb47v8h73tactuh@4ax.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4983&group=comp.os.linux.misc#4983

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.gegeweb.eu!gegeweb.org!goblin3!goblin.stu.neva.ru!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 11 May 2021 23:49:34 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 12 May 2021 00:49:34 -0400
Message-ID: <n8nm9g5dfl6ngctfsbvlb47v8h73tactuh@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com> <u1inmh-bqp.ln1@Telcontar.valinor> <8svj9ghouubccv4o2lgoo2jlrfh1s3jvdq@4ax.com> <s7damq$obm$2@dont-email.me> <p38qmh-eo7.ln1@Telcontar.valinor>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Lines: 36
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-mvPNLZGKwDLg/Js3UMfwfS657hYmsEHzJm6gUfsoCPpo7rY1uuPmlHLlNH4WF5KEciTPFREy83JP+Wf!GOrmHUYO+a4YB75iCTlu868l7vRByX+4rPb4G2hlYnoP0/hoJu0Ro/J2+Xc33S39R7r3Je1z+1Si!0V78FjY6WCjoFgQ=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2563
 by: MSB - Wed, 12 May 2021 04:49 UTC

On Tue, 11 May 2021 13:58:17 +0200, "Carlos E.R."
<robin_listas@es.invalid> wrote:

>On 11/05/2021 09.11, The Natural Philosopher wrote:
>> On 11/05/2021 05:44, MSB wrote:
>>>> Pascal doesn't. Not in the basic libraries, at least.
>>>    Um ... I seem to remember it being in Microsoft Pascal
>>
>> True pascal doesn't have any IO at all. As with any language designed by
>> an academic, it was completely useless for real world usage.
>>
>
>True pascal of course had IO. Input, output, and files. You defined them
>in the first line
>
>program hello (output);
>
>
>However, I have never seen "true" pascal. It doesn't exist.

I tend to agree. Perhaps he's talking about some
alpha version Wirth hadn't fully fleshed out yet.

>With Turbo Pascal I did things like hanging from the timer interrupt and
>play music in background as the the user played a game in the same
>program, or writing a serial port terminal using the serial interrupt
>for faster access than the commercial terminal I was given.

Hey ! That's about what I first used it for ... though no
music - app was for a digitizing tablet for serious govt
types, No Fun Allowed.

You could do the serial interrrupt thing in BASICA too,
FAR better if you compiled it with BASCOM. However
when TP came out I rewrote my BASICA apps.

Re: Why No "fcopy()" in 'C' ?

<dlnm9gh2v8g2498uqcsrn53glfsbtim6hq@4ax.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4984&group=comp.os.linux.misc#4984

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 12 May 2021 00:15:35 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 12 May 2021 01:15:35 -0400
Message-ID: <dlnm9gh2v8g2498uqcsrn53glfsbtim6hq@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s79kuo$19bd$1@gioia.aioe.org> <ageh9g1dnfltim7qnad5io4vmnhq7rjjab@4ax.com> <s7eo0f$dcr$4@dont-email.me>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 30
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-F6znbJvHQXxHDWop52giD37sjCRc5D5yzPf9lcoc09xHkGIzR5mIVaW0cI2m5Uv5gQfdkrpr0YAmwZc!IFNN++uIcqUplDUJZSy8nT5BRQFGz2sUeJyO9lIZF20aSbDCzv5IMKzIuA690w/6r9nxkVXqtvwG!oF8kXU9RfxUzFok=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2339
 by: MSB - Wed, 12 May 2021 05:15 UTC

On Tue, 11 May 2021 20:04:31 -0000 (UTC), Lew Pitcher
<lew.pitcher@digitalfreehold.ca> wrote:

>On Mon, 10 May 2021 00:48:21 -0400, MSB wrote:
>
>> Are K or R still alive ? Maybe we can ask.
>
>Ken Thompson (the designer and original implementor of Unix) is still alive,
>as is Brian Kernighan. Dennis Ritchie (the designer of the C language, and
>implementor of Unix-written-in-C), sadly, passed away in 2011.

I think of K&R sort of like Spielberg and Lucas or Jobs & Woz.
Each brought their talents and perspective and the synthesis
was greater than the parts.

Alas R would have been the one to ask about THIS simple
little question - which seems to have gotten out of hand.

I wonder what will eventually replace 'C' ? AI systems are
mostly 'C' under the hood, now, but eventually I see the
underlying system being composed in and by the larger
AI system. This is not unprecedented, PICK-OS started
mostly as 'C', but quickly it was its own beginning and
end - PICK written in PICK.

I miss PICK ... sure, IBM and a few others will sell you
what's essentially a PICK-OS/MV-DB ... but the price
is a killer. (still think the MV model is best for most
real-world data though)

Re: Why No "fcopy()" in 'C' ?

<87k0o4z7vj.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4985&group=comp.os.linux.misc#4985

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!.POSTED.nntp.terraraq.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 12 May 2021 09:14:24 +0100
Organization: terraraq NNTP server
Message-ID: <87k0o4z7vj.fsf@LkoBDZeT.terraraq.uk>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s79kuo$19bd$1@gioia.aioe.org>
<ageh9g1dnfltim7qnad5io4vmnhq7rjjab@4ax.com>
<slrns9jtvg.j96.spamtrap42@one.localnet>
<tsuj9gh0qsqfge4vg0v742vjrc833i8bu1@4ax.com>
<s7drtn$l8j$2@dont-email.me> <87sg2tz1h6.fsf@LkoBDZeT.terraraq.uk>
<s7ee8i$4t1$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: mantic.terraraq.uk; posting-host="nntp.terraraq.uk:2a00:1098:0:86:1000:3f:0:2";
logging-data="18605"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:ZZFFEL2rsObeu1thNuxEWyr1Mg0=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Wed, 12 May 2021 08:14 UTC

Rich <rich@example.invalid> writes:
> Richard Kettlewell <invalid@invalid.invalid> wrote:
>> Rich <rich@example.invalid> writes:
>>> MSB <Bit15_.us> wrote:
>>>> A "standard" function, like "printf" or "fopen()" is generally a
>>>> GOOD thing, gets everyone on the same track instead of continually
>>>> re-inventing the wheel (with the inevitible little variations).
>>>
>>> And, in C the language, there is also no printf() and no fopen().
>>> Both of those are supplied by the libraries that accompany most
>>> implementations of C the language.
>>
>> The OP is obviously talking about hosted implementations, not
>> free-standing ones.
>
> While the OP has 'drifted' in his subsequent posts into additionally
> talking about hosted implementations, it is not at all obvious that was
> their initial question's framework.
>
> Their original was here:
> Message-ID: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
>
> And there is certainly nothing in that initial post that "obviously"
> indicates they are talking about hosted implementations.

Now you’re just being silly. Hosted implementations have IO and
free-standing implementations don’t (indeed they barely have a libc at
all), so yes, it is obvious that he was talking about hosted
implementations.

--
https://www.greenend.org.uk/rjk/

Re: Why No "fcopy()" in 'C' ?

<s7gk6a$ggn$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4986&group=comp.os.linux.misc#4986

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ric...@example.invalid (Rich)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 12 May 2021 13:11:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <s7gk6a$ggn$1@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com> <u1inmh-bqp.ln1@Telcontar.valinor> <8svj9ghouubccv4o2lgoo2jlrfh1s3jvdq@4ax.com> <s7damq$obm$2@dont-email.me> <p38qmh-eo7.ln1@Telcontar.valinor> <n8nm9g5dfl6ngctfsbvlb47v8h73tactuh@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 12 May 2021 13:11:38 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e34920d61c4eb22ac51105f792f749ae";
logging-data="16919"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SNEmYjdwvffiN+Wqr2T2B"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:Hwsh1MRAVTelNDaOtbwXNAeMQlk=
 by: Rich - Wed, 12 May 2021 13:11 UTC

MSB <Bit15_.us> wrote:
> On Tue, 11 May 2021 13:58:17 +0200, "Carlos E.R."
> <robin_listas@es.invalid> wrote:
>
>>On 11/05/2021 09.11, The Natural Philosopher wrote:
>>> On 11/05/2021 05:44, MSB wrote:
>>>>> Pascal doesn't. Not in the basic libraries, at least.
>>>>    Um ... I seem to remember it being in Microsoft Pascal
>>>
>>> True pascal doesn't have any IO at all. As with any language designed by
>>> an academic, it was completely useless for real world usage.
>>>
>>
>>True pascal of course had IO. Input, output, and files. You defined them
>>in the first line
>>
>>program hello (output);
>>
>>
>>However, I have never seen "true" pascal. It doesn't exist.
>
> I tend to agree. Perhaps he's talking about some
> alpha version Wirth hadn't fully fleshed out yet.

No, he is talking about Wirth's actual Pascal (which Wirth never
intended to build a compiler for). Wirth designed it to use in classes
without ever being compiled/interpreted (other than by a human grader).
So it never needed input/output, because it was never intended (by
Wirth) to be compiled/interpreted (other than by a human grading
assignments).

Re: Why No "fcopy()" in 'C' ?

<s7gknf$ggn$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4987&group=comp.os.linux.misc#4987

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ric...@example.invalid (Rich)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 12 May 2021 13:20:47 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <s7gknf$ggn$2@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s7eldp$dcr$1@dont-email.me> <s7en7k$dcr$3@dont-email.me> <s7eo6l$dcr$5@dont-email.me> <z46dncKcx8LKbQf9nZ2dnUU78SvNnZ2d@giganews.com> <s7essd$lur$2@dont-email.me> <yYedncTUQJMEkgb9nZ2dnUU7-a_NnZ2d@giganews.com> <slrns9mg94.rtj.spamtrap42@one.localnet> <rclm9g5p3fccssosr9228c9q84o2nbsduq@4ax.com>
Injection-Date: Wed, 12 May 2021 13:20:47 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e34920d61c4eb22ac51105f792f749ae";
logging-data="16919"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18SXzOOlVI88WqUBA8xm0dp"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:DJiGgnZrKkjHtaOUHbVO8t5bO10=
 by: Rich - Wed, 12 May 2021 13:20 UTC

MSB <Bit15_.us> wrote:
> Geez ... my little inquiry seems to have gotten out of hand. I
> assumed there'd be somebody a bit before my time who could clearly
> explain why no standard fcopy() was in 'C'. Instead .............
> :-)

Yes, your trolling has been /loads of fun/...

If you genuinely wanted an answer, and were really looking for folks
who would likely know, you'd have posted to 'comp.lang.c'. Posting
here, in the wrong group for that question, looks very trollish.

But, given the length of time that has passed with no file copy
function having been added to the basic C I/O library, the "obvious"
answer is that having one must not have been as "obvious" to everyone
who had a hand in creating C's I/O library than you feel it is now.

When years go by, with huge popularity and usage by many very capable
programmers over those years, and a file copy function is still not
there, that then suggests that none of those greats found a need
suffient to cause them to make the addition or suggest the addition to
those maintaining the library. I.e., the fact that those programmers,
far better than yourself, never found a need weighs heavily in favor of
it not being as obvious a need as you believe.

Re: Why No "fcopy()" in 'C' ?

<s12tmh-c8v.ln1@Telcontar.valinor>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4988&group=comp.os.linux.misc#4988

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: robin_li...@es.invalid (Carlos E.R.)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 12 May 2021 15:33:16 +0200
Lines: 44
Message-ID: <s12tmh-c8v.ln1@Telcontar.valinor>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
<u1inmh-bqp.ln1@Telcontar.valinor>
<8svj9ghouubccv4o2lgoo2jlrfh1s3jvdq@4ax.com> <s7damq$obm$2@dont-email.me>
<p38qmh-eo7.ln1@Telcontar.valinor>
<n8nm9g5dfl6ngctfsbvlb47v8h73tactuh@4ax.com> <s7gk6a$ggn$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net Aa+y99+yIsFPf7LHdQLlZwuBqU0y7ZrPTyUWYuv/wisYBwrm8h
X-Orig-Path: Telcontar.valinor!not-for-mail
Cancel-Lock: sha1:w9pFlxLK2oIeYsIm44+pYNWJBDQ=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.0
In-Reply-To: <s7gk6a$ggn$1@dont-email.me>
Content-Language: en-CA
 by: Carlos E.R. - Wed, 12 May 2021 13:33 UTC

On 12/05/2021 15.11, Rich wrote:
> MSB <Bit15_.us> wrote:
>> On Tue, 11 May 2021 13:58:17 +0200, "Carlos E.R."
>> <robin_listas@es.invalid> wrote:
>>
>>> On 11/05/2021 09.11, The Natural Philosopher wrote:
>>>> On 11/05/2021 05:44, MSB wrote:
>>>>>> Pascal doesn't. Not in the basic libraries, at least.
>>>>>    Um ... I seem to remember it being in Microsoft Pascal
>>>>
>>>> True pascal doesn't have any IO at all. As with any language designed by
>>>> an academic, it was completely useless for real world usage.
>>>>
>>>
>>> True pascal of course had IO. Input, output, and files. You defined them
>>> in the first line
>>>
>>> program hello (output);
>>>
>>>
>>> However, I have never seen "true" pascal. It doesn't exist.
>>
>> I tend to agree. Perhaps he's talking about some
>> alpha version Wirth hadn't fully fleshed out yet.
>
> No, he is talking about Wirth's actual Pascal (which Wirth never
> intended to build a compiler for). Wirth designed it to use in classes
> without ever being compiled/interpreted (other than by a human grader).
> So it never needed input/output, because it was never intended (by
> Wirth) to be compiled/interpreted (other than by a human grading
> assignments).
>

Define what you mean by input/output.

Because the first line of a program as designed by Wirth was:

program something(input, output);

So indeed it had input/output.

--
Cheers, Carlos.

Re: Why No "fcopy()" in 'C' ?

<s7goi2$5f3$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4989&group=comp.os.linux.misc#4989

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tauno.vo...@notused.fi.invalid (Tauno Voipio)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 12 May 2021 17:26:10 +0300
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <s7goi2$5f3$1@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
<u1inmh-bqp.ln1@Telcontar.valinor>
<8svj9ghouubccv4o2lgoo2jlrfh1s3jvdq@4ax.com> <s7damq$obm$2@dont-email.me>
<p38qmh-eo7.ln1@Telcontar.valinor>
<n8nm9g5dfl6ngctfsbvlb47v8h73tactuh@4ax.com> <s7gk6a$ggn$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 12 May 2021 14:26:11 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b2107a087f3332d2a9af552b52af4d29";
logging-data="5603"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/AV2FJRfablVNKDczI/adqSuYuBgNXUU0="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0)
Gecko/20100101 Thunderbird/78.10.1
Cancel-Lock: sha1:9SlQt8G02oar9bg5SF53K7AHA7I=
In-Reply-To: <s7gk6a$ggn$1@dont-email.me>
Content-Language: en-GB
 by: Tauno Voipio - Wed, 12 May 2021 14:26 UTC

On 12.5.21 16.11, Rich wrote:
> MSB <Bit15_.us> wrote:
>> On Tue, 11 May 2021 13:58:17 +0200, "Carlos E.R."
>> <robin_listas@es.invalid> wrote:
>>
>>> On 11/05/2021 09.11, The Natural Philosopher wrote:
>>>> On 11/05/2021 05:44, MSB wrote:
>>>>>> Pascal doesn't. Not in the basic libraries, at least.
>>>>>    Um ... I seem to remember it being in Microsoft Pascal
>>>>
>>>> True pascal doesn't have any IO at all. As with any language designed by
>>>> an academic, it was completely useless for real world usage.
>>>>
>>>
>>> True pascal of course had IO. Input, output, and files. You defined them
>>> in the first line
>>>
>>> program hello (output);
>>>
>>>
>>> However, I have never seen "true" pascal. It doesn't exist.
>>
>> I tend to agree. Perhaps he's talking about some
>> alpha version Wirth hadn't fully fleshed out yet.
>
> No, he is talking about Wirth's actual Pascal (which Wirth never
> intended to build a compiler for). Wirth designed it to use in classes
> without ever being compiled/interpreted (other than by a human grader).
> So it never needed input/output, because it was never intended (by
> Wirth) to be compiled/interpreted (other than by a human grading
> assignments).

Three Wirth's students, Urs Ammann, Kesav Nori and Christian Jacobi
wrote the first Pascal compiler - in Pascal.

I may still have its listings somewhere.

--

-TV

Re: Why No "fcopy()" in 'C' ?

<87eeecyo9p.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4990&group=comp.os.linux.misc#4990

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!nntp.terraraq.uk!.POSTED.nntp.terraraq.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 12 May 2021 16:17:54 +0100
Organization: terraraq NNTP server
Message-ID: <87eeecyo9p.fsf@LkoBDZeT.terraraq.uk>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me>
<i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
<u1inmh-bqp.ln1@Telcontar.valinor>
<8svj9ghouubccv4o2lgoo2jlrfh1s3jvdq@4ax.com>
<s7damq$obm$2@dont-email.me> <p38qmh-eo7.ln1@Telcontar.valinor>
<n8nm9g5dfl6ngctfsbvlb47v8h73tactuh@4ax.com>
<s7gk6a$ggn$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: mantic.terraraq.uk; posting-host="nntp.terraraq.uk:2a00:1098:0:86:1000:3f:0:2";
logging-data="24621"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:wNHwHpuCoXjIB+Hc6m6PYSItj8g=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Wed, 12 May 2021 15:17 UTC

Rich <rich@example.invalid> writes:
> No, he is talking about Wirth's actual Pascal (which Wirth never
> intended to build a compiler for). Wirth designed it to use in classes
> without ever being compiled/interpreted (other than by a human grader).
> So it never needed input/output, because it was never intended (by
> Wirth) to be compiled/interpreted (other than by a human grading
> assignments).

Over here in reality, Wirth knew perfectly well that a language without
an implementation would be totally pointless. He intended to build a
compiler for it and indeed did so.

It is never sufficient to merely postulate a language on paper. A solid
compiler also had to be built, which usually was a highly complex
program. In this respect, large industrial firms had an advantage over
our Working Group, which had to rely on enthusiasts at universities. I
left the Group in 1966 and devoted myself together with a few doctoral
students at Stanford University to the construction of a compiler for my
proposal.

The result was the language Algol W,2 which after 1967 came into use
at many locations on large IBM computers. It became quite
successful. The milestone Algol 68 did appear and then sank quickly
into obscurity under its own weight, although a few of its concepts
did survive into subsequent languages.

But in my opinion Algol W was not perfectly satisfactory. It still
contained too many compromises, having emerged from a committee. After
my return to Switzerland, I designed a language after my own
preferences: Pascal. Together with a few assistants, we wrote a user
manual and constructed a compiler.

https://cacm.acm.org/magazines/2021/3/250705-50-years-of-pascal/fulltext

--
https://www.greenend.org.uk/rjk/

Re: Why No "fcopy()" in 'C' ?

<ig2b1fFu2j3U2@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4991&group=comp.os.linux.misc#4991

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: boblat...@yahoo.com (Robert Latest)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: 12 May 2021 15:37:19 GMT
Lines: 29
Message-ID: <ig2b1fFu2j3U2@mid.individual.net>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
<s7bfd1$v8q$1@dont-email.me> <tt2k9gd0j7ua3trhe9n3qnhellm9ovfdun@4ax.com>
X-Trace: individual.net LMkqzlK1w8W9ATyl2AUkTwk8PnMfrY6XRu3EY4QngxNbK5CDS3
Cancel-Lock: sha1:mS51I27ltpjsMmYipj/ygK0/fB8=
User-Agent: slrn/1.0.3 (Linux)
 by: Robert Latest - Wed, 12 May 2021 15:37 UTC

MSB wrote:
>>
>>> so why not fcopy() ???
>>
>>There is no "fcopy" syscall. So no 'fcopy' in libc.
>
> In Linux/Unix it's a "cp" or "mv" syscall. Didn't do
> everything I wanted.

No, those are programs (binaries) or shell built-ins. Not syscalls.

> My curiosity has to do with "standardization". On the
> whole it's a GOOD thing - gets everybody on the same
> wavelength, so to speak. A standard fcopy() just seems
> so OBVIOUS.

Not to me or anybody else who is answering this thread.

>>> It's not a real impediment, just weird. A "hole" in the
>>> overall paradigm.

Name a single function in the C standard library that is remotely as complex
and as implementation-dependent as your proposed fcopy(). Better yet, name a
bunch of them so we can see the "hole" better.

I believe you don't understand the paradigm.

--
robert

Re: Why No "fcopy()" in 'C' ?

<ig2bdrFu2j3U3@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4992&group=comp.os.linux.misc#4992

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: boblat...@yahoo.com (Robert Latest)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: 12 May 2021 15:43:56 GMT
Lines: 17
Message-ID: <ig2bdrFu2j3U3@mid.individual.net>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
<s7bfd1$v8q$1@dont-email.me> <tt2k9gd0j7ua3trhe9n3qnhellm9ovfdun@4ax.com>
<s7drhh$l8j$1@dont-email.me> <haim9g1ircm44c537m6qu93fsqrgdp152m@4ax.com>
X-Trace: individual.net 3rafqki/rE0P6N/MXtRQ1wjbvKl25zj5h7wwBcHYVjUMhZhtAf
Cancel-Lock: sha1:VDRoDjcoaiil3jbqH6JHnimX5Qg=
User-Agent: slrn/1.0.3 (Linux)
 by: Robert Latest - Wed, 12 May 2021 15:43 UTC

MSB wrote:
> Technically true. However you won't find a terminal emulator
> without 'cp' in some form or another.

Your terminal emulator is interacting with a program called a "shell" in Unix
(similar concepts exist on other OSes). This shell has either a built-in "cp"
program, or it calls a binary that does the copying.

> If not stricty 'kernel' it
> is still a core function. NO sort of OS/system is going to be
> without a handy fcopy()-like command.

Then just use that. It really doesn't belong in the core library of any
universal programming language.

--
robert

Re: Why No "fcopy()" in 'C' ?

<ig2bnkFu2j3U4@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4993&group=comp.os.linux.misc#4993

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: boblat...@yahoo.com (Robert Latest)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: 12 May 2021 15:49:08 GMT
Lines: 28
Message-ID: <ig2bnkFu2j3U4@mid.individual.net>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s7eldp$dcr$1@dont-email.me> <s7en7k$dcr$3@dont-email.me>
<s7eo6l$dcr$5@dont-email.me>
<z46dncKcx8LKbQf9nZ2dnUU78SvNnZ2d@giganews.com>
<s7essd$lur$2@dont-email.me>
<yYedncTUQJMEkgb9nZ2dnUU7-a_NnZ2d@giganews.com>
<slrns9mg94.rtj.spamtrap42@one.localnet>
<rclm9g5p3fccssosr9228c9q84o2nbsduq@4ax.com>
X-Trace: individual.net oykFVnyjVjsaFDqDYrV/AQ98jachHiNj5G87/jZi87/nPC+jg7
Cancel-Lock: sha1:Ymn2GhryhgKQ9Ff4Y6htxQ09QdU=
User-Agent: slrn/1.0.3 (Linux)
 by: Robert Latest - Wed, 12 May 2021 15:49 UTC

MSB wrote:
> Recently I re-invented the wheel yet again, writing an
> fcopy(). I spent some time wondering whether to use
> open/write/close -vs- fopen/fwrite/fclose. I shouldn't
> have had to waste the time.

You just answered your own question. If you had an idea of how a standardized
fcopy() should work you'd have written it ONCE a long time ago and just used it
in your projects. The fact that you keep re-writing it shows that there is no
one answer to this problem.

> They are NOT quite
> the same ... fwrite() can sometimes try to "fix"
> line endings - assuming you're writing text instead
> of binary. I eventually settled on open/write/close
> instead just because of that possibility. Just a dozen
> lines - a few dedicated to immediate bail-out if the
> caller screwed up and sent garbage params ( I like
> to cover Stupid Users and send useful error codes
> when they screw up).

Next guy needs raw speed and has pre-verified data and doesn't want your
fcopy() to waste time on checks. Next guy wants to copy between open file
handles.

--
robert

Pages:1234
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor