Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"You can't make a program without broken egos."


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
Why No "fcopy()" in 'C' ?

<mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>

  copy mid

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

  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: Fri, 07 May 2021 22:29:37 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Why No "fcopy()" in 'C' ?
Date: Fri, 07 May 2021 23:29:37 -0400
Message-ID: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 12
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-wMib9+PLSGhK6gLoVuQEDY6X63aMWQip/6r7jR9n2lqEHp5FdunheFwDE75LQ8k+wyWxnANpLMhRPHI!hAA/ib7/LcDPJ5fqNu3C2d0h9Svrj/4aBVIKTR/gZA9daD0p8fsIjOVRg2n/SfmTft+atkvTT56e!wisOGAWxegQ00mk=
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: 1406
 by: MSB - Sat, 8 May 2021 03:29 UTC

"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.

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 ?

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

<s75hlb$dgt$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Sat, 8 May 2021 09:20:59 +0100
Organization: A little, after lunch
Lines: 27
Message-ID: <s75hlb$dgt$1@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 8 May 2021 08:20:59 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4939a3a54bf4dea43e31c94b68c40dba";
logging-data="13853"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/lADbrBUCi33KHM+HTZ6XPBuT65dOpC70="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:FCeoWTvjFz6nrW7xdxTbormxbBQ=
In-Reply-To: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
Content-Language: en-GB
 by: The Natural Philosop - Sat, 8 May 2021 08:20 UTC

On 08/05/2021 04:29, 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.
>
> 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 ?
>
I think you need to look back at what environment C and Unix started on
- a PDP-11 IIRC - to understand the philosophy: as little built in as
possible. with only 128K RAM to play woth, you dont want to have huge
libraries.

fcopy exists, it's called cp...at the Unix, rather than the C, level

--
Of what good are dead warriors? … Warriors are those who desire battle
more than peace. Those who seek battle despite peace. Those who thump
their spears on the ground and talk of honor. Those who leap high the
battle dance and dream of glory … The good of dead warriors, Mother, is
that they are dead.
Sheri S Tepper: The Awakeners.

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

<s75ptp$n13$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dan1es...@gmail.com (Dan Espen)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Sat, 08 May 2021 06:42:01 -0400
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <s75ptp$n13$1@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="6b6270d4fffda705973f1cc413bbc965";
logging-data="23587"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19L3CN6CChA9L6SjmZJN/u+wLKNk8lL1OE="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:LvqrQiPqw4+5d2WwZ9zwmIy9Cf8=
 by: Dan Espen - Sat, 8 May 2021 10:42 UTC

MSB <Bit15_.us> writes:

> "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.
>
> 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 ?

It may seem basic, but how about needed?
If something isn't needed why should someone create it?

--
Dan Espen

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

<s79kuo$19bd$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!Lg5V075veXo70LAZyuhKKg.user.gioia.aioe.org.POSTED!not-for-mail
From: asd...@nospam.com (asdf)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Sun, 9 May 2021 21:41:44 +0000 (UTC)
Organization: Aioe.org NNTP Server
Lines: 8
Message-ID: <s79kuo$19bd$1@gioia.aioe.org>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
NNTP-Posting-Host: Lg5V075veXo70LAZyuhKKg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
X-No-Archive: Yes
X-Notice: Filtered by postfilter v. 0.9.2
 by: asdf - Sun, 9 May 2021 21:41 UTC

On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:

> We have all sorts of handy string functions and a zillion other neat-o
> things in the various libraries - but no fcopy().

The reason is simpy that the vast majoity of the system C has
been ported on don't even know what a file is, therefore it is
not necessary to have it built in.

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

<bich9glu22m5un20nl4qsu2m734a1pe0uv@4ax.com>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc3.netnews.com!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.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: Sun, 09 May 2021 23:36:39 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Mon, 10 May 2021 00:36:39 -0400
Message-ID: <bich9glu22m5un20nl4qsu2m734a1pe0uv@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s75hlb$dgt$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: 58
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-doNB72xHmotUvKnXW/u+tQJcm8BUIEYrl9Y0QsLvnSMvCswcl7DJfPJZk5vp0QwU60NJR0QSCvD4wGx!SI03MTF+7GEZBNoOZQ782hs2XRFx1f0fHREFXhi/am25jgR+WKoFqcW8lTQvEWS6SuSN6uf2UqCE!27XUaoz7NqpDvaY=
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: 3460
 by: MSB - Mon, 10 May 2021 04:36 UTC

On Sat, 8 May 2021 09:20:59 +0100, The Natural Philosopher
<tnp@invalid.invalid> wrote:

>On 08/05/2021 04:29, 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.
>>
>> 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 ?
>>
>I think you need to look back at what environment C and Unix started on
>- a PDP-11 IIRC - to understand the philosophy: as little built in as
>possible. with only 128K RAM to play woth, you dont want to have huge
>libraries.
>
>fcopy exists, it's called cp...at the Unix, rather than the C, level

Yes, but I got tired of composing a system() command - and it
didn't do ALL I wanted. My makedirs() not only parses out and
(possibly) creates the whole dest chain but also tries to open
a probe file there to confirm writability. The fcopy() bit copies
and transfers the permissions/owner/dates stuff AND has a
flag so you can allow, or disallow, overwrite of an existing
file of the same name. Not many lines of code ... so it's
just so weird 'C' never put it in a standard library.

PDP-11 (hallowed be its name) may not have had much
memory to play with, but the need for a clean safe file
copy still existed - you'd just do it with much smaller
buffers.

Gee ... I'd love a "modern" PDP-11 with the same basic
instructions - just in 64 bits :-)

Actually, emulators these days would be a LOT faster
than the original chipset ...but it's just not the same.

And a 68000-64/128 with all the modern speed features
would be heaven on earth.

Never got to program the PDP ... but I did some work
for the LSI-11 way back when. Almost the same, just
a bit clunkier.

A lot of the old chips had unique and interesting solutions
to certain problems. Remember the TMS-990/9900 ...
it handled a multi-user environment with on-chip methods,
allocating a new 64k 'workspace' for users/tasks in
system memory (which was better than on-chip cache
at the time). BLWP ... Branch And Load Workspace
Pointer .....

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

<i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.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: Sun, 09 May 2021 23:43:29 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Mon, 10 May 2021 00:43:29 -0400
Message-ID: <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s75ptp$n13$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: 33
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-rBqT/Eflvvb5wCZq+1lxEij/NKqG7inPs87wKyj5LOzAEGgAaO8MsT1gAW6FQk0n3XQ52UZryJneAFL!wYEnkTxosA5p5oYBn3a6Vzcd6VznkmA4G2aSRLutTLj+2TIyuKXC+tdBmNWoxXz/twrNgOCrBQqK!C7IbOy8YqqCS3uQ=
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: 2223
 by: MSB - Mon, 10 May 2021 04:43 UTC

On Sat, 08 May 2021 06:42:01 -0400, Dan Espen <dan1espen@gmail.com>
wrote:

>MSB <Bit15_.us> writes:
>
>> "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.
>>
>> 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 ?
>
>It may seem basic, but how about needed?
>If something isn't needed why should someone create it?

I would assert that "copy file" is SO basic and essential
that it should have been one of the first entries in some
standard library. We have rename(), we have remove(),
we have stat(). so why not fcopy() ???

Basically every other decent language HAS its version
of fcopy(), usually with a lot of useful options. Not 'C'.

It's not a real impediment, just weird. A "hole" in the
overall paradigm. If it was intentional - I'm trying to
find out why.

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

<ageh9g1dnfltim7qnad5io4vmnhq7rjjab@4ax.com>

  copy mid

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

  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!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: Sun, 09 May 2021 23:48:21 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Mon, 10 May 2021 00:48:21 -0400
Message-ID: <ageh9g1dnfltim7qnad5io4vmnhq7rjjab@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s79kuo$19bd$1@gioia.aioe.org>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 21
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-YS99gOhf5Y3EWnyybFPGrrdNKIs392rMCG8fzZh89cEuCd6ddxETCOBeMJdwyo3mX+kxrvoDDM6YyeE!ZHO85PyAwSha67igyKtgxq9V0QH98KgAcHSmG7WJPktTLAvvokF59u+EpFjf/zBJpuBUCNku+imM!440v7C8pkXk6RQY=
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: 1780
 by: MSB - Mon, 10 May 2021 04:48 UTC

On Sun, 9 May 2021 21:41:44 +0000 (UTC), asdf <asdf@nospam.com> wrote:

>On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:
>
>> We have all sorts of handy string functions and a zillion other neat-o
>> things in the various libraries - but no fcopy().
>
>The reason is simpy that the vast majoity of the system C has
>been ported on don't even know what a file is, therefore it is
>not necessary to have it built in.

Um ... disagree strongly. "Copy stuff" is an ultra-basic need.
Doesn't matter if it's CP/M or DOS or -ix .... most everything
DOES have a concept of a "file", or at least "block of binary
data on device".

So, I see it as weird 'C' never dealt with this early on.

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

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

<s7ahtn$fur$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Mon, 10 May 2021 06:56:06 +0100
Organization: A little, after lunch
Lines: 16
Message-ID: <s7ahtn$fur$1@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s79kuo$19bd$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 May 2021 05:56:07 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6f43e1b4ef6d83414832fc9d887a4cd8";
logging-data="16347"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19DCUFdSoolXhHOU9lQVJU7+cK65sMTALA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:QQ8gRbOQFm0+/rV/MjBsRAoTSCI=
In-Reply-To: <s79kuo$19bd$1@gioia.aioe.org>
Content-Language: en-GB
 by: The Natural Philosop - Mon, 10 May 2021 05:56 UTC

On 09/05/2021 22:41, asdf wrote:
> On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:
>
>> We have all sorts of handy string functions and a zillion other neat-o
>> things in the various libraries - but no fcopy().
>
> The reason is simpy that the vast majoity of the system C has
> been ported on don't even know what a file is, therefore it is
> not necessary to have it built in.
>
That's why fopen() doesn't exist either...
....sheesh

--
"It is an established fact to 97% confidence limits that left wing
conspirators see right wing conspiracies everywhere"

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

<s7b10f$g51$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dan1es...@gmail.com (Dan Espen)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Mon, 10 May 2021 06:13:35 -0400
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <s7b10f$g51$1@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me>
<i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="6588fe7fcea39b735682a3b18272b52c";
logging-data="16545"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vE+dP02GHHphjF2w22KQP/MAe7UIxid4="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:FNQUjQByBMchDEgNSFv7SG+9vVU=
 by: Dan Espen - Mon, 10 May 2021 10:13 UTC

MSB <Bit15_.us> writes:

> On Sat, 08 May 2021 06:42:01 -0400, Dan Espen <dan1espen@gmail.com>
> wrote:
>
>>MSB <Bit15_.us> writes:
>>
>>> "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.
>>>
>>> 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 ?
>>
>>It may seem basic, but how about needed?
>>If something isn't needed why should someone create it?
>
> I would assert that "copy file" is SO basic and essential
> that it should have been one of the first entries in some
> standard library. We have rename(), we have remove(),
> we have stat(). so why not fcopy() ???
>
> Basically every other decent language HAS its version
> of fcopy(), usually with a lot of useful options. Not 'C'.
>
> It's not a real impediment, just weird. A "hole" in the
> overall paradigm. If it was intentional - I'm trying to
> find out why.

You have still not described why a C programmer would need a function
like this. I can't figure a use case except in backup. That hardly
makes it worthwhile to put this in libc.

So, now your claim is that fcopy is basic and "essential".
You are making that "essential" part up.

--
Dan Espen

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

<u1inmh-bqp.ln1@Telcontar.valinor>

  copy mid

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

  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: Mon, 10 May 2021 13:29:34 +0200
Lines: 53
Message-ID: <u1inmh-bqp.ln1@Telcontar.valinor>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 8hmzmbelJQNU4n5VKmyPGAPfAPcohkmkAQ+feDNNBfpQsbnyvE
X-Orig-Path: Telcontar.valinor!not-for-mail
Cancel-Lock: sha1:2zVlIgS4X8Ei5UuIK/lI3h4jnhc=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.0
In-Reply-To: <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
Content-Language: en-CA
 by: Carlos E.R. - Mon, 10 May 2021 11:29 UTC

On 10/05/2021 06.43, MSB wrote:
> On Sat, 08 May 2021 06:42:01 -0400, Dan Espen <dan1espen@gmail.com>
> wrote:
>
>> MSB <Bit15_.us> writes:
>>
>>> "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.
>>>
>>> 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 ?
>>
>> It may seem basic, but how about needed?
>> If something isn't needed why should someone create it?
>
> I would assert that "copy file" is SO basic and essential
> that it should have been one of the first entries in some
> standard library. We have rename(), we have remove(),
> we have stat(). so why not fcopy() ???
>
> Basically every other decent language HAS its version
> of fcopy(), usually with a lot of useful options. Not 'C'.

Pascal doesn't. Not in the basic libraries, at least.

>
> It's not a real impediment, just weird. A "hole" in the
> overall paradigm. If it was intentional - I'm trying to
> find out why.

One reason would be that any function in the basic library was linked in
the final code even if not used, making it bigger. There would be many
other functions that also could be useful.

Sometime in the 90's, I compared the sizes of "Hello world!" made with
both Borland C and Borland Pascal. C version was 32 KB, BP was 3 KB.
Borland Pascal used a non standard linking method that only included the
code that was actually used in the program, producing much smaller code.

I don't remember if the extended libraries of Borland Pascal or C, which
allowed full text interfaces with mouse support and file browsing
functions included a file copy function or not. Funny that you could
edit text but not copy a file :-D

--
Cheers, Carlos.

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

<s7bfd1$v8q$1@dont-email.me>

  copy mid

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

  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: Mon, 10 May 2021 14:19:13 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <s7bfd1$v8q$1@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
Injection-Date: Mon, 10 May 2021 14:19:13 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="01c1d51ce7c91e9a3f3fc57405bbcfdd";
logging-data="32026"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19DloN7wvLMmuaUAgckj6hK"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:49OoYMVrq8mpafuOe8JL2oSWxpE=
 by: Rich - Mon, 10 May 2021 14:19 UTC

MSB <Bit15_.us> wrote:
> On Sat, 08 May 2021 06:42:01 -0400, Dan Espen <dan1espen@gmail.com>
> wrote:
>
>>MSB <Bit15_.us> writes:
>>
>>> "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.
>>>
>>> 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 ?
>>
>>It may seem basic, but how about needed?
>>If something isn't needed why should someone create it?
>
> I would assert that "copy file" is SO basic and essential
> that it should have been one of the first entries in some
> standard library. We have rename(),

Rename is a syscall, which is why it is there.

> we have remove(),

Remove is also a syscall (unlink), which is also why it is in the
library.

> we have stat().

Stat is ultimately another syscall, which is why it is also there.

> so why not fcopy() ???

There is no "fcopy" syscall. So no 'fcopy' in libc.

> It's not a real impediment, just weird. A "hole" in the
> overall paradigm. If it was intentional - I'm trying to
> find out why.

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.

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

<877dk61x32.fsf@LkoBDZeT.terraraq.uk>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.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: Mon, 10 May 2021 15:29:21 +0100
Organization: terraraq NNTP server
Message-ID: <877dk61x32.fsf@LkoBDZeT.terraraq.uk>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me>
<i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
<s7bfd1$v8q$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="13907"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:YK43XpovGeM6hNMVdvkc5Ri3x5g=
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 - Mon, 10 May 2021 14:29 UTC

Rich <rich@example.invalid> writes:
> MSB <Bit15_.us> wrote:
>> I would assert that "copy file" is SO basic and essential that it
>> should have been one of the first entries in some standard
>> library. We have rename(),
>
> Rename is a syscall, which is why it is there.
>
>> we have remove(),
>
> Remove is also a syscall (unlink), which is also why it is in the
> library.

Not always. For instance on some platforms it’s unlink, backing off to
rmdir if that didn’t work.

>> we have stat().
>
> Stat is ultimately another syscall, which is why it is also there.
>
>> so why not fcopy() ???
>
> There is no "fcopy" syscall. So no 'fcopy' in libc.
>
>> It's not a real impediment, just weird. A "hole" in the
>> overall paradigm. If it was intentional - I'm trying to
>> find out why.
>
> 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.

This argument makes very little sense. There are loads of C library
functions that aren’t syscalls; strcpy for instance.

I suspect the real answer is that nobody cared enough to add it as a
standard function.

As it happens there is a copy_file_range syscall in the Linux kernel,
reflecting that the kernel can do a better job of copying files than a
userland process, in some situations. So it’s not a particularly silly
suggestion.

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

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

<slrns9jtvg.j96.spamtrap42@one.localnet>

  copy mid

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

  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: 11 May 2021 03:20:16 GMT
Organization: none-at-all
Lines: 30
Message-ID: <slrns9jtvg.j96.spamtrap42@one.localnet>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s79kuo$19bd$1@gioia.aioe.org> <ageh9g1dnfltim7qnad5io4vmnhq7rjjab@4ax.com>
Reply-To: spamtrap42@jacob21819.net
X-Trace: individual.net SVA4g//igg7GuetG1AJCSQtRNJyUrtvChJ8Fg4hvcaqlG2b9ej
Cancel-Lock: sha1:gJsTNMuquzh2JISk8yrSOXqtNAs=
User-Agent: slrn/1.0.3 (Linux)
 by: Robert Riches - Tue, 11 May 2021 03:20 UTC

On 2021-05-10, MSB <Bit15_.us> wrote:
> On Sun, 9 May 2021 21:41:44 +0000 (UTC), asdf <asdf@nospam.com> wrote:
>
>>On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:
>>
>>> We have all sorts of handy string functions and a zillion other neat-o
>>> things in the various libraries - but no fcopy().
>>
>>The reason is simpy that the vast majoity of the system C has
>>been ported on don't even know what a file is, therefore it is
>>not necessary to have it built in.
>
> Um ... disagree strongly. "Copy stuff" is an ultra-basic need.
> Doesn't matter if it's CP/M or DOS or -ix .... most everything
> DOES have a concept of a "file", or at least "block of binary
> data on device".
>
> So, I see it as weird 'C' never dealt with this early on.
>
> Are K or R still alive ? Maybe we can ask.

Your "most everything" does not include the EKG/ECG sensor unit I
and a few other developers worked on several years ago. Okay,
that device used ThreadX rather than Linux/Unix, so the library
did not have other file functions, either.

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

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

<tsuj9gh0qsqfge4vg0v742vjrc833i8bu1@4ax.com>

  copy mid

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

  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!tr1.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: Mon, 10 May 2021 22:49:57 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Mon, 10 May 2021 23:49:57 -0400
Message-ID: <tsuj9gh0qsqfge4vg0v742vjrc833i8bu1@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s79kuo$19bd$1@gioia.aioe.org> <ageh9g1dnfltim7qnad5io4vmnhq7rjjab@4ax.com> <slrns9jtvg.j96.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: 49
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-akNscsHG8u8Y3qKw7rS/YO1nKOoKRovnM6HQUC/X3qSdGUOYTLKkDH08UCmgBAQj5xDItEjPcY63Gwz!Ik68T6LNyX2R5l8ZX8OL1HEF38Ukr94EJpsVntW2IxSfQ5BGejJixpy2pI74ZYUgo9l+vV4k6Vf2!bYfSGSOFo0gcYfc=
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: 3180
 by: MSB - Tue, 11 May 2021 03:49 UTC

On 11 May 2021 03:20:16 GMT, Robert Riches <spamtrap42@jacob21819.net>
wrote:

>On 2021-05-10, MSB <Bit15_.us> wrote:
>> On Sun, 9 May 2021 21:41:44 +0000 (UTC), asdf <asdf@nospam.com> wrote:
>>
>>>On Fri, 07 May 2021 23:29:37 -0400, MSB wrote:
>>>
>>>> We have all sorts of handy string functions and a zillion other neat-o
>>>> things in the various libraries - but no fcopy().
>>>
>>>The reason is simpy that the vast majoity of the system C has
>>>been ported on don't even know what a file is, therefore it is
>>>not necessary to have it built in.
>>
>> Um ... disagree strongly. "Copy stuff" is an ultra-basic need.
>> Doesn't matter if it's CP/M or DOS or -ix .... most everything
>> DOES have a concept of a "file", or at least "block of binary
>> data on device".
>>
>> So, I see it as weird 'C' never dealt with this early on.
>>
>> Are K or R still alive ? Maybe we can ask.
>
>Your "most everything" does not include the EKG/ECG sensor unit I
>and a few other developers worked on several years ago. Okay,
>that device used threadX rather than Linux/Unix, so the library
>did not have other file functions, either.

I've writ a number of apps for micro-controllers, 8051/PIC, and
there's nothing higher-level unless YOU create it. Arduino
libraries are super-civilized by comparison - actually have
"files" and "devices" and such ... you can save files to an
FAT SD card or EEPROM or i2c-FRAM no problem.

But we're not talking PIC 12Fxxx ...

Even in the PDP-11 days there WERE "files" and you'd
want to copy/rename/delete/append.

So it's just a mystery why no standard fcopy() was
ever writ. It's not a critical issue, you can implement
a full-featured fcopy() in about 15-20 lines or so.
I'm just very CURIOUS. This seems to be a glaring
"hole" in the language. 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).

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

<8svj9ghouubccv4o2lgoo2jlrfh1s3jvdq@4ax.com>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!news.uzoreto.com!tr3.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: Mon, 10 May 2021 23:44:04 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 00:44:04 -0400
Message-ID: <8svj9ghouubccv4o2lgoo2jlrfh1s3jvdq@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com> <u1inmh-bqp.ln1@Telcontar.valinor>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 98
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-yUjDVnPwHp7iyaJtwVJXjUE0n4bQFEdxYVd9Fo5sA6RyeF9e5j1aduVPYxL13Dx0jmtr80UEcNY6ARp!hRjcGb2pi6+SG5r4WExkgidkBeyVFeLblfxb/bOyqz+oZqszAIqJo4JT7Qt680On0a2xMggPqEkS!3IOcxTADHAg9SQE=
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: 5303
 by: MSB - Tue, 11 May 2021 04:44 UTC

On Mon, 10 May 2021 13:29:34 +0200, "Carlos E.R."
<robin_listas@es.invalid> wrote:

>On 10/05/2021 06.43, MSB wrote:
>> On Sat, 08 May 2021 06:42:01 -0400, Dan Espen <dan1espen@gmail.com>
>> wrote:
>>
>>> MSB <Bit15_.us> writes:
>>>
>>>> "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.
>>>>
>>>> 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 ?
>>>
>>> It may seem basic, but how about needed?
>>> If something isn't needed why should someone create it?
>>
>> I would assert that "copy file" is SO basic and essential
>> that it should have been one of the first entries in some
>> standard library. We have rename(), we have remove(),
>> we have stat(). so why not fcopy() ???
>>
>> Basically every other decent language HAS its version
>> of fcopy(), usually with a lot of useful options. Not 'C'.
>
>Pascal doesn't. Not in the basic libraries, at least.

Um ... I seem to remember it being in Microsoft Pascal - and
that was a LONG time ago, some years before Turbo. Nick
understood the concept of a "file" ... and the things you'd need
to do with them. (Actually met Nick once ... but "correct"
structure was an obsession with him - leading to the great
disappointment of Modula - 'PC' destroying real-world
utility).

Wrote a Lazarus/FP app just the other week - STILL a good
language/RAD-Environment. Why waste tons of time with
Tk or GTK or QT or the others .... Lazarus/Delphi will give
you a WYSIWYG GUI with all the bells and whistles like
super-quick - fully compiled. Even works on a Pi.

Of course "raw" 'C' - no stdio.h or anything - is a pretty
stupid language too. However by the time K&R wrote
the book there were already a bunch of standard libraries.
Their most basic examples used printf().

>
>>
>> It's not a real impediment, just weird. A "hole" in the
>> overall paradigm. If it was intentional - I'm trying to
>> find out why.
>
>One reason would be that any function in the basic library was linked in
>the final code even if not used, making it bigger. There would be many
>other functions that also could be useful.

Wasn't long before compilers/linkers were smart enough
to drop "unused" references. And an fcopy() would have
been a relatively small bit of code to boot.

>Sometime in the 90's, I compared the sizes of "Hello world!" made with
>both Borland C and Borland Pascal. C version was 32 KB, BP was 3 KB.
>Borland Pascal used a non standard linking method that only included the
>code that was actually used in the program, producing much smaller code.

Turbo/Borland ... now Delphi/Lazarus ... was a HUGE improvement
over what was "usual" before.

TP2 was just *great* - and when TP3 came along I even found a
good use for the LOGO-ish "turtle" ... as a rotating wind arrow in
a weather app. Beat translating Foley/VanDam's "Fundamentals
of Interactive Computer Graphics" code :-)

Wrote big TP programs back then - big enough to require
the "overlay" functions on crappy 640k IBM-PCs (ok, not
as crappy as CP/M systems :-)

>I don't remember if the extended libraries of Borland Pascal or C, which
>allowed full text interfaces with mouse support and file browsing
>functions included a file copy function or not. Funny that you could
>edit text but not copy a file :-D

Mice came later - at least to the PC world. However you could
do most anything with text and keyboard - AND files. Don't
immediately remember an fcopy() for early TP .... mostly
you'd open a file and write data blocks - 90% like in 'C' now.

Anyway, I'm just curious - fcopy() is something OBVIOUS,
and thus a GAP, in 'C'. It's persistence in the modern world
is just so odd.

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

<tt2k9gd0j7ua3trhe9n3qnhellm9ovfdun@4ax.com>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!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 00:05:20 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 01:05:20 -0400
Message-ID: <tt2k9gd0j7ua3trhe9n3qnhellm9ovfdun@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com> <s7bfd1$v8q$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: 67
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-yQo6C+pxA0p7LUX83rDrL8CP85mVqorXNmp7W87shvEbltsRLoHM4sNojIfATq5SdLsyt/VaXZ3V67s!9IWySnCnZY0oIuT3xYTOcpvY+kZhf4xmD36/qy/E0q6Ii7CqPktVnOMWIRdfDUG/pLlf5HK5rjZ+!lUapUfzocJJTDZw=
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: 3534
 by: MSB - Tue, 11 May 2021 05:05 UTC

On Mon, 10 May 2021 14:19:13 -0000 (UTC), Rich <rich@example.invalid>
wrote:

>MSB <Bit15_.us> wrote:
>> On Sat, 08 May 2021 06:42:01 -0400, Dan Espen <dan1espen@gmail.com>
>> wrote:
>>
>>>MSB <Bit15_.us> writes:
>>>
>>>> "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.
>>>>
>>>> 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 ?
>>>
>>>It may seem basic, but how about needed?
>>>If something isn't needed why should someone create it?
>>
>> I would assert that "copy file" is SO basic and essential
>> that it should have been one of the first entries in some
>> standard library. We have rename(),
>
>Rename is a syscall, which is why it is there.
>
>> we have remove(),
>
>Remove is also a syscall (unlink), which is also why it is in the
>library.
>
>> we have stat().
>
>Stat is ultimately another syscall, which is why it is also there.
>
>> 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.

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.

>> It's not a real impediment, just weird. A "hole" in the
>> overall paradigm. If it was intentional - I'm trying to
>> find out why.
>
>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". There was barely any
concept of an OS then except on the Big Iron. Your A2/Commodore
and such didn't have an OS - just a bunch of little ROM/BIOS
library routines. Code excuted at address-0+<small-offset>
and that was that, basically like microcontrollers.

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

<s7damq$obm$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 08:11:22 +0100
Organization: A little, after lunch
Lines: 11
Message-ID: <s7damq$obm$2@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
<s75ptp$n13$1@dont-email.me> <i3eh9gh0d7csidbq15k91otpdghimq2g3l@4ax.com>
<u1inmh-bqp.ln1@Telcontar.valinor>
<8svj9ghouubccv4o2lgoo2jlrfh1s3jvdq@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 11 May 2021 07:11:22 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="fde5f152d0c3fdf01848bb48d3e551d2";
logging-data="24950"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vll0wNNtVK8GRZpWWgAS810+lK6mKgx4="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:1plX566GOaFmZqAwYGzrf3tloWM=
In-Reply-To: <8svj9ghouubccv4o2lgoo2jlrfh1s3jvdq@4ax.com>
Content-Language: en-GB
 by: The Natural Philosop - Tue, 11 May 2021 07:11 UTC

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.

--
In a Time of Universal Deceit, Telling the Truth Is a Revolutionary Act.

- George Orwell

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

<s7dapk$obm$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 11 May 2021 08:12:52 +0100
Organization: A little, after lunch
Lines: 11
Message-ID: <s7dapk$obm$3@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>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 11 May 2021 07:12:52 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="fde5f152d0c3fdf01848bb48d3e551d2";
logging-data="24950"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18iM+cN5xyEMv/4g/XTilNIeKKmOqOxH3Q="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:VXN5geMWPoLtMsY3/vxt7SNO5eE=
In-Reply-To: <tt2k9gd0j7ua3trhe9n3qnhellm9ovfdun@4ax.com>
Content-Language: en-GB
 by: The Natural Philosop - Tue, 11 May 2021 07:12 UTC

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....

--
“Puritanism: The haunting fear that someone, somewhere, may be happy.”

H.L. Mencken, A Mencken Chrestomathy

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

<871rad1sim.fsf@LkoBDZeT.terraraq.uk>

  copy mid

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

  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: Tue, 11 May 2021 11:20:17 +0100
Organization: terraraq NNTP server
Message-ID: <871rad1sim.fsf@LkoBDZeT.terraraq.uk>
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
Injection-Info: mantic.terraraq.uk; posting-host="nntp.terraraq.uk:2a00:1098:0:86:1000:3f:0:2";
logging-data="31847"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:4nhlZrP4xZA+eT7sw67M+iqdAtM=
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 - Tue, 11 May 2021 10:20 UTC

The Natural Philosopher <tnp@invalid.invalid> writes:
> 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....

Unix predates C by several years. See https://www.tuhs.org/cgi-bin/utree.pl

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

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

<s7drhh$l8j$1@dont-email.me>

  copy mid

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

  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: Tue, 11 May 2021 11:58:41 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <s7drhh$l8j$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>
Injection-Date: Tue, 11 May 2021 11:58:41 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4e8c3b286aa2c6a20cb47fef1add76d9";
logging-data="21779"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QCLqpuK6hxM23zM3Byizs"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:+5zCg6glFohM3e/L4N6FcFiKtPg=
 by: Rich - Tue, 11 May 2021 11:58 UTC

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.

>>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.

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.

...
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.

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

<p38qmh-eo7.ln1@Telcontar.valinor>

  copy mid

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

  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: Tue, 11 May 2021 13:58:17 +0200
Lines: 24
Message-ID: <p38qmh-eo7.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>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net HpPru9iSOroZTDKhwHyQnQ1daxr+dF+ydz2T2/n4fFI1hkErqI
X-Orig-Path: Telcontar.valinor!not-for-mail
Cancel-Lock: sha1:/FtWxKxALh2Jtr+OqcgJ/uHdJd4=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.0
In-Reply-To: <s7damq$obm$2@dont-email.me>
Content-Language: en-CA
 by: Carlos E.R. - Tue, 11 May 2021 11:58 UTC

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.

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.

--
Cheers, Carlos.

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

<s7drtn$l8j$2@dont-email.me>

  copy mid

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

  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: Tue, 11 May 2021 12:05:12 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <s7drtn$l8j$2@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <s79kuo$19bd$1@gioia.aioe.org> <ageh9g1dnfltim7qnad5io4vmnhq7rjjab@4ax.com> <slrns9jtvg.j96.spamtrap42@one.localnet> <tsuj9gh0qsqfge4vg0v742vjrc833i8bu1@4ax.com>
Injection-Date: Tue, 11 May 2021 12:05:12 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4e8c3b286aa2c6a20cb47fef1add76d9";
logging-data="21779"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18McXnamIB9A+2fNpy6u2TC"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:5TnOU4qeqjka9vLAR1Czs+LAam0=
 by: Rich - Tue, 11 May 2021 12:05 UTC

MSB <Bit15_.us> wrote:
> So it's just a mystery why no standard fcopy() was
> ever writ. It's not a critical issue, you can implement
> a full-featured fcopy() in about 15-20 lines or so.
> I'm just very CURIOUS.

And, you answered your own question. When "you can implement a
full-featured fcopy() in about 15-20 lines or so" then that becomes a
candidate for "don't bother adding it to libc, it is trivial to
implement when/if someone wants it".

Remember, the Unix philosophy is small, single purpose tools, that
compose into larger tools. Libc provides all the necessary "small,
single purpose tools" for an fcopy(), so the "composition" of those
tools into a larger tool was left up to the end user.

> This seems to be a glaring "hole" in the language.

C the language is very minimal. Your complaint is actually "why do the
standard I/O libraries omit an fcopy() function".

> 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.

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

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

  copy mid

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

  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: Tue, 11 May 2021 17:20:21 +0100
Organization: terraraq NNTP server
Message-ID: <87sg2tz1h6.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>
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="4389"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:fBfXR6gWdbMTxqUMfkhjKKTFdhg=
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 - Tue, 11 May 2021 16:20 UTC

Rich <rich@example.invalid> writes:
> MSB <Bit15_.us> wrote:
>> So it's just a mystery why no standard fcopy() was
>> ever writ. It's not a critical issue, you can implement
>> a full-featured fcopy() in about 15-20 lines or so.
>> I'm just very CURIOUS.
>
> And, you answered your own question. When "you can implement a
> full-featured fcopy() in about 15-20 lines or so" then that becomes a
> candidate for "don't bother adding it to libc, it is trivial to
> implement when/if someone wants it".

The C library is full of tiny functions, much smaller than that in their
V7 implementations, so the “no small functions” argument doesn’t work.

> Remember, the Unix philosophy is small, single purpose tools, that
> compose into larger tools. Libc provides all the necessary "small,
> single purpose tools" for an fcopy(), so the "composition" of those
> tools into a larger tool was left up to the end user.

There’s plenty of functions that are compositions of simpler ones, too,
e.g. putchar and getchar (you could use putc/getc instead), puts and
printf (use fprintf instead). So the “no compositions” argument doesn’t
work.

You seem to be trying to retroactively invent a rationale without
actually knowing what thought, if any, went into the original decision,
and without taking into account any counterexamples to your arguments.

Personally I think it’s more likely that it simply didn’t occur to
anyone (i.e. and the OP is wrong that it’s an obvious thing to include).

>> This seems to be a glaring "hole" in the language.
>
> C the language is very minimal. Your complaint is actually "why do the
> standard I/O libraries omit an fcopy() function".
>
>> 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.

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

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

<s7ee8i$4t1$1@dont-email.me>

  copy mid

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

  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: Tue, 11 May 2021 17:18:11 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <s7ee8i$4t1$1@dont-email.me>
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>
Injection-Date: Tue, 11 May 2021 17:18:11 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4e8c3b286aa2c6a20cb47fef1add76d9";
logging-data="5025"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MQ/AJjv2KECOKQxAJsurp"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:m4UO5NPw2qZhM6OE5FSaQlFdRhk=
 by: Rich - Tue, 11 May 2021 17:18 UTC

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.

In any case, I'm beginning to believe the OP is actually trolling. If
they really had wanted an answer then comp.os.linux.misc is not the
correct group to ask, instead comp.lang.c would be where they would
properly ask this question.

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

<s7eldp$dcr$1@dont-email.me>

  copy mid

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

  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:20:26 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 29
Message-ID: <s7eldp$dcr$1@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 11 May 2021 19:20:26 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="236b848e3227806415e265b88fc6da95";
logging-data="13723"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4oPVZi3BemkGKBjJLzb23+PnQir3x9xE="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:wydd+tnjKEBDcdo8FzoH+uenNTk=
 by: Lew Pitcher - Tue, 11 May 2021 19:20 UTC

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).

HTH
--
Lew Pitcher
"In Skills, We Trust"

Pages:1234
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor