Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

There are bugs and then there are bugs. And then there are bugs. -- Karl Lehenbauer


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' ?

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

 copy mid

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

 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: Fri, 14 May 2021 08:26:42 +0100
Organization: terraraq NNTP server
Message-ID: <87wns1ydvx.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> <87k0o4z7vj.fsf@LkoBDZeT.terraraq.uk>
<q1vr9gpqt5bgprotdb46enc4kk9l3ss4aa@4ax.com>
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="27628"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:CLqe1+1XNkR9+gsnnmlarf1/R8c=
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 - Fri, 14 May 2021 07:26 UTC

MSB <Bit15_.us> writes:
> On Wed, 12 May 2021 09:14:24 +0100, Richard Kettlewell
>>Rich <rich@example.invalid> writes:
>>> Richard Kettlewell <invalid@invalid.invalid> wrote:
>>>> 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.
>
> Nope. Was talking about GCC actually (or Clang, almost the same thing
> these days).
>
> NO fcopy() in GCC.

There’s no fopen() in GCC either. If you want to get into this level of
detail you should look into how the compiler and library components are
divided up.

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

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

<s7lgqv$9v1$1@dont-email.me>

 copy mid

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

 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: Fri, 14 May 2021 12:45:03 +0300
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <s7lgqv$9v1$1@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>
<ig2bnkFu2j3U4@mid.individual.net> <s7h17a$gqv$1@dont-email.me>
<3b7p9gtsqsb6h0ijmhjhdugunnsf37836g@4ax.com> <s7jhaa$5jm$1@dont-email.me>
<slrns9rnfv.99t.spamtrap42@one.localnet>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 14 May 2021 09:45:03 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="749ae9e2154b16f969fa0837d7a9d02b";
logging-data="10209"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18SypsfDMnhZVBTheaHlND6No5nvz298h4="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0)
Gecko/20100101 Thunderbird/78.10.1
Cancel-Lock: sha1:ZxZFDeZFNzv5WqYCOHDA11C2rIc=
In-Reply-To: <slrns9rnfv.99t.spamtrap42@one.localnet>
Content-Language: en-GB
 by: Tauno Voipio - Fri, 14 May 2021 09:45 UTC

On 14.5.21 5.18, Robert Riches wrote:
> On 2021-05-13, Tauno Voipio <tauno.voipio@notused.fi.invalid> wrote:
>> On 13.5.21 7.02, MSB wrote:
>>> On Wed, 12 May 2021 19:54:01 +0300, Tauno Voipio
>>> <tauno.voipio@notused.fi.invalid> wrote:
>>>
>>>> For simple copy we have cp, and for brute-force copy there is dd.
>>>
>>>
>>> Most of the time I *do* just "cheap out" with system("cp ....").
>>> It's easy, it works - albeit a bit ugly and "un-C".
>>>
>>> I did find that "mv" doesn't always get it right ... if a filename
>>> includes weirdo characters.
>>
>> mv is *not* a copy operation, it is a shell cover for the rename()
>> system call.
>
> At least in old-days Unix, if the source and destination are on
> different mountpoints, "mv" will copy the file to the destination
> directory/file and then delete the source. Does the rename()
> system call do that? The man page does not say it does.
>

Right - the OP feels so confused that I did not want to complicate
any further.

--

-TV

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

<s7lsie$7do$1@dont-email.me>

 copy mid

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

 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: Fri, 14 May 2021 13:05:18 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <s7lsie$7do$1@dont-email.me>
References: <s7eo6l$dcr$5@dont-email.me> <z46dncKcx8LKbQf9nZ2dnUU78Sd$lurd@giganews.com> <s7esscTUur$2@dont-email.me> <yYedncTUQJMEkgb9nZ2dnUU7-a_NnZ2d@giganews.com> <slrns9mg94.rtj.spamtrap42@one.localnet> <rclm9g5p3fccssosr9228c9q84o2nbsduq@4ax.com> <ig2bnkFu2j3U4@mid.individual.net> <s7h17a$gqv$1@dont-email.me> <3b7p9gtsqsb6h0ijmhjhdugunnsf37836g@4ax.com> <s7jhaa$5jm$1@dont-email.me> <6gsr9glh98d4vf0o8qc9jueb6r9h4bkrjl@4ax.com> <s7ktfd$aip$1@dont-email.me> <0b0s9gpcog1sdc3fcjllq42573s7k7ovg8@4ax.com>
Injection-Date: Fri, 14 May 2021 13:05:18 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="23e44688b1e81faa99fdc112d23832cd";
logging-data="7608"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tobAQ8suNPrW3UcF3y1NB"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:ubZ1LrFbWNxwA5ihQuXa8mydUy4=
 by: Rich - Fri, 14 May 2021 13:05 UTC

MSB <Bit15_.us> wrote:
> On Fri, 14 May 2021 04:14:37 -0000 (UTC), Rich <rich@example.invalid>
> wrote:
>
>>MSB <Bit15_.us> wrote:
>>> On Thu, 13 May 2021 18:40:57 +0300, Tauno Voipio
>>> <tauno.voipio@notused.fi.invalid> wrote:
>>>
>>>>On 13.5.21 7.02, MSB wrote:
>>>>> On Wed, 12 May 2021 19:54:01 +0300, Tauno Voipio
>>>>> <tauno.voipio@notused.fi.invalid> wrote:
>>>>>
>>>>>> For simple copy we have cp, and for brute-force copy there is dd.
>>>>>
>>>>>
>>>>> Most of the time I *do* just "cheap out" with system("cp ....").
>>>>> It's easy, it works - albeit a bit ugly and "un-C".
>>>>>
>>>>> I did find that "mv" doesn't always get it right ... if a filename
>>>>> includes weirdo characters.
>>>>
>>>>mv is *not* a copy operation, it is a shell cover for the rename()
>>>>system call.
>>>
>>> But it does NOT always work the same. Names with any
>>> kind of "escape" characters MAY not be handled properly.
>>
>>That is not mv's fault. That is the fault of the programmer who did
>>not properly escape shell special characters when using system() to
>>call 'mv'. The system() library call uses /bin/sh, so all the
>>characters that are special to /bin/sh have to first be escaped so
>>/bin/sh will not modify them.
>
> Sorry, but I collect filenames and then DO stuff
> with them - and do NOT want to have to out-think
> "mv" for every possible instance, making my code
> five times larger and more complex.

Again, you expose your complete lack of understanding. You are not
'outthinking mv'. By the time 'mv' receives the strings that are the
filenames it is being asked to work with, those strings have already
been interpreted by /bin/sh. And it is /bin/sh that is changing them.
The mv command simply consumes the strings it is given without
modification.

You have to 'outthink /bin/sh' if you want to use the system() library
call from C to execute mv to move (or possibly copy, depending) a file
around.

And if you want to use the system() library function for calling any
external binary, and if you want to pass strings to that binary as its
argc array, you *must* outthink /bin/sh if you want your code to work
with all possibilities of filenames.

> So, now, it's rename() instead of system("mv ...) forever and
> always.

Which will only work as long as both the source and destination path
are on the same mounted filesystem. Once you try to cross a mountpoint
you'll get back an EXDEV error from rename().

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

<ig7jl1Fg9eU1@mid.individual.net>

 copy mid

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

 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: jpstew...@personalprojects.net (John-Paul Stewart)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Fri, 14 May 2021 11:34:56 -0400
Lines: 28
Message-ID: <ig7jl1Fg9eU1@mid.individual.net>
References: <s7eo6l$dcr$5@dont-email.me>
<z46dncKcx8LKbQf9nZ2dnUU78Sd$lurd@giganews.com> <s7esscTUur$2@dont-email.me>
<yYedncTUQJMEkgb9nZ2dnUU7-a_NnZ2d@giganews.com>
<slrns9mg94.rtj.spamtrap42@one.localnet>
<rclm9g5p3fccssosr9228c9q84o2nbsduq@4ax.com>
<ig2bnkFu2j3U4@mid.individual.net> <s7h17a$gqv$1@dont-email.me>
<3b7p9gtsqsb6h0ijmhjhdugunnsf37836g@4ax.com> <s7jhaa$5jm$1@dont-email.me>
<6gsr9glh98d4vf0o8qc9jueb6r9h4bkrjl@4ax.com> <s7ktfd$aip$1@dont-email.me>
<0b0s9gpcog1sdc3fcjllq42573s7k7ovg8@4ax.com> <s7lsie$7do$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net EE1eqcnqz3WNFGzQQg95fAlO4n/eGEKfdNvMXcY4l1SPq61Muk
Cancel-Lock: sha1:xPo5sArvx9l1bebPXMi3hmHAl4U=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.0
In-Reply-To: <s7lsie$7do$1@dont-email.me>
Content-Language: en-CA
 by: John-Paul Stewart - Fri, 14 May 2021 15:34 UTC

On 2021-05-14 9:05 a.m., Rich wrote:
>
> Again, you expose your complete lack of understanding. You are not
> 'outthinking mv'. By the time 'mv' receives the strings that are the
> filenames it is being asked to work with, those strings have already
> been interpreted by /bin/sh. And it is /bin/sh that is changing them.
> The mv command simply consumes the strings it is given without
> modification.
>
> You have to 'outthink /bin/sh' if you want to use the system() library
> call from C to execute mv to move (or possibly copy, depending) a file
> around.
>
> And if you want to use the system() library function for calling any
> external binary, and if you want to pass strings to that binary as its
> argc array, you *must* outthink /bin/sh if you want your code to work
> with all possibilities of filenames.

And if you *don't* want to deal with escaping shell arguments, you
*don't* use system() in the first place, since its whole purpose is to
launch a shell.

To launch an external command from C without an intermediate shell, the
previous poster should have been using one of the exec family of
functions, such as execlp() or execvp().

The only reason to use system() is when you *want* a shell to interpret
some of those special characters.

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

<bmju9gpci1fl2pogc59284tn8raiku1pg7@4ax.com>

 copy mid

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

 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!buffer1.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 14 May 2021 23:50:28 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Sat, 15 May 2021 00:50:28 -0400
Message-ID: <bmju9gpci1fl2pogc59284tn8raiku1pg7@4ax.com>
References: <s7esscTUur$2@dont-email.me> <yYedncTUQJMEkgb9nZ2dnUU7-a_NnZ2d@giganews.com> <slrns9mg94.rtj.spamtrap42@one.localnet> <rclm9g5p3fccssosr9228c9q84o2nbsduq@4ax.com> <ig2bnkFu2j3U4@mid.individual.net> <s7h17a$gqv$1@dont-email.me> <3b7p9gtsqsb6h0ijmhjhdugunnsf37836g@4ax.com> <s7jhaa$5jm$1@dont-email.me> <6gsr9glh98d4vf0o8qc9jueb6r9h4bkrjl@4ax.com> <s7ktfd$aip$1@dont-email.me> <0b0s9gpcog1sdc3fcjllq42573s7k7ovg8@4ax.com> <s7lsie$7do$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: 82
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-ggfchZ1xbYtSzJIAd0dhmii2YOMoqD3/skoaXoYlsJFFLWDsmSJCBj31kIE4szwRZ7Rb2YaOyGiUkt0!CU46hS5MgITzMouQdb2CVQtWwwg7vBwZpwR5xOIRbJs5V7UxI/TeH10UAhyQSi12gA8nZD6sUx3k!f6zCCMMcmQzxAD8=
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: 4760
 by: MSB - Sat, 15 May 2021 04:50 UTC

On Fri, 14 May 2021 13:05:18 -0000 (UTC), Rich <rich@example.invalid>
wrote:

>MSB <Bit15_.us> wrote:
>> On Fri, 14 May 2021 04:14:37 -0000 (UTC), Rich <rich@example.invalid>
>> wrote:
>>
>>>MSB <Bit15_.us> wrote:
>>>> On Thu, 13 May 2021 18:40:57 +0300, Tauno Voipio
>>>> <tauno.voipio@notused.fi.invalid> wrote:
>>>>
>>>>>On 13.5.21 7.02, MSB wrote:
>>>>>> On Wed, 12 May 2021 19:54:01 +0300, Tauno Voipio
>>>>>> <tauno.voipio@notused.fi.invalid> wrote:
>>>>>>
>>>>>>> For simple copy we have cp, and for brute-force copy there is dd.
>>>>>>
>>>>>>
>>>>>> Most of the time I *do* just "cheap out" with system("cp ....").
>>>>>> It's easy, it works - albeit a bit ugly and "un-C".
>>>>>>
>>>>>> I did find that "mv" doesn't always get it right ... if a filename
>>>>>> includes weirdo characters.
>>>>>
>>>>>mv is *not* a copy operation, it is a shell cover for the rename()
>>>>>system call.
>>>>
>>>> But it does NOT always work the same. Names with any
>>>> kind of "escape" characters MAY not be handled properly.
>>>
>>>That is not mv's fault. That is the fault of the programmer who did
>>>not properly escape shell special characters when using system() to
>>>call 'mv'. The system() library call uses /bin/sh, so all the
>>>characters that are special to /bin/sh have to first be escaped so
>>>/bin/sh will not modify them.
>>
>> Sorry, but I collect filenames and then DO stuff
>> with them - and do NOT want to have to out-think
>> "mv" for every possible instance, making my code
>> five times larger and more complex.
>
>Again, you expose your complete lack of understanding. You are not
>'outthinking mv'. By the time 'mv' receives the strings that are the
>filenames it is being asked to work with, those strings have already
>been interpreted by /bin/sh. And it is /bin/sh that is changing them.
>The mv command simply consumes the strings it is given without
>modification.
>
>You have to 'outthink /bin/sh' if you want to use the system() library
>call from C to execute mv to move (or possibly copy, depending) a file
>around.

You seem increasingly hostile for some very odd reason.
I may 'fcopy' you into my killfile .........

I think "mv" is really "copy+delete" at heart. You CAN access
the dir records directly and just change the name, but I don't
think it does that. "Copy+delete" is just easier, maybe safer,
though not faster. As I said somewhere else, I/O delays are
what use up most of the time, not the copy/rename code
unless you're doing in-memory files.

>And if you want to use the system() library function for calling any
>external binary, and if you want to pass strings to that binary as its
>argc array, you *must* outthink /bin/sh if you want your code to work
>with all possibilities of filenames.

Um, no ... I will out-think 'mv' by going AROUND it. I'm not
into masochism.

>> So, now, it's rename() instead of system("mv ...) forever and
>> always.
>
>Which will only work as long as both the source and destination path
>are on the same mounted filesystem. Once you try to cross a mountpoint
>you'll get back an EXDEV error from rename().

So, I'll always keep them on the same filesystem. Do
whatever else afterwards. A restriction, but not a bad one.

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

<vpku9g5ffpmejje9et83bsqjmvr02cii2j@4ax.com>

 copy mid

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

 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!newsfeed7.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: Sat, 15 May 2021 00:03:14 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Sat, 15 May 2021 01:03:14 -0400
Message-ID: <vpku9g5ffpmejje9et83bsqjmvr02cii2j@4ax.com>
References: <yYedncTUQJMEkgb9nZ2dnUU7-a_NnZ2d@giganews.com> <slrns9mg94.rtj.spamtrap42@one.localnet> <rclm9g5p3fccssosr9228c9q84o2nbsduq@4ax.com> <ig2bnkFu2j3U4@mid.individual.net> <s7h17a$gqv$1@dont-email.me> <3b7p9gtsqsb6h0ijmhjhdugunnsf37836g@4ax.com> <s7jhaa$5jm$1@dont-email.me> <6gsr9glh98d4vf0o8qc9jueb6r9h4bkrjl@4ax.com> <s7ktfd$aip$1@dont-email.me> <0b0s9gpcog1sdc3fcjllq42573s7k7ovg8@4ax.com> <s7lsie$7do$1@dont-email.me> <ig7jl1Fg9eU1@mid.individual.net>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 60
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-ask4fPpsUJxp4jY0e6kbJgJZ3AYn9DX4WuGYklr9oV1kuHTssV9uYiw6ChoE/g1R4Dt6N8pjViZ+jNx!BwmyJWdRK1Dse3E8fjfAw00GVHfVyeDZREORkkCEL6EozauCfNvi6T9AGfsyr6un5T8pkhe6MQD9!fBabwYs3M7OwPEQ=
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: 3822
 by: MSB - Sat, 15 May 2021 05:03 UTC

On Fri, 14 May 2021 11:34:56 -0400, John-Paul Stewart
<jpstewart@personalprojects.net> wrote:

>On 2021-05-14 9:05 a.m., Rich wrote:
>>
>> Again, you expose your complete lack of understanding. You are not
>> 'outthinking mv'. By the time 'mv' receives the strings that are the
>> filenames it is being asked to work with, those strings have already
>> been interpreted by /bin/sh. And it is /bin/sh that is changing them.
>> The mv command simply consumes the strings it is given without
>> modification.
>>
>> You have to 'outthink /bin/sh' if you want to use the system() library
>> call from C to execute mv to move (or possibly copy, depending) a file
>> around.
>>
>> And if you want to use the system() library function for calling any
>> external binary, and if you want to pass strings to that binary as its
>> argc array, you *must* outthink /bin/sh if you want your code to work
>> with all possibilities of filenames.
>
>And if you *don't* want to deal with escaping shell arguments, you
>*don't* use system() in the first place, since its whole purpose is to
>launch a shell.

'Zactly ... which is why I switched to rename(). No more problems.
It is NOT exactly the same as system("mv ...) - it does not seem to
try and interpret escape sequences.

Winders, cursed be thy name ...... I have a weird suspicion that
by allowing so many kinds of "weird" filenames we are looking
at deliberate "Linux persecution" by MS.

Which is almost funny NOW ... word is that, down under the
hood, MS is quietly converting Winders into Linux/UNIX - just
preserving the "look and feel".

>To launch an external command from C without an intermediate shell, the
>previous poster should have been using one of the exec family of
>functions, such as execlp() or execvp().

Yep. Works better ... albeit a little more effort.

>The only reason to use system() is when you *want* a shell to interpret
>some of those special characters.

OR, you're just lazy and/or pressed for time and don't want
to deal with the other methods ....

Depending on the employer, you MAY be "on the clock",
expected to deliver in a given timeframe. Taking shortcuts
is inevitable ....

Uh oh ... Navy releases more UFO tapes. I *think* we're
being prepped for a Big Revelation ........

Do Aliens use 'C' ?

Do they like Brocolli ?

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

<samu9g9l2agfklrtrs1me55nbcdtmji6tg@4ax.com>

 copy mid

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

 copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!goblin2!goblin3!goblin.stu.neva.ru!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 15 May 2021 00:41:36 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Sat, 15 May 2021 01:41:36 -0400
Message-ID: <samu9g9l2agfklrtrs1me55nbcdtmji6tg@4ax.com>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <slrns9jtvg.j96.spamtrap42@one.localnet> <tsuj9gh0qsqfge4vg0v742vjrc833i8bu1@4ax.com> <s7drtn$l8j$2@dont-email.me> <eli$2105111314@qaz.wtf>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 83
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-VOZ7+v4bbIVPNcTWlB6X8XglSeXg9+mRe89bOF2n3WI9mqrVmw2sn7CpS36nNqpbM4M4D+at9brwHP5!SC94/wTyGDGGT/q1/Fm5BbXaU3MXjI1pKFw8h12v9EuPTNUr7nPHs5ukEGDYdwzvjgI+HvRORk6h!0FEAYGy/wqCzjXc=
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: 5027
 by: MSB - Sat, 15 May 2021 05:41 UTC

On Tue, 11 May 2021 17:14:29 +0000 (UTC), Eli the Bearded
<*@eli.users.panix.com> wrote:

>In comp.os.linux.misc, Rich <rich@example.invalid> wrote:
>> 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.
>
>As with Richard Kettlewell in another reply, I don't buy that. Let's
>consider a real example.
>
>ex version 1.1 (the first one to have a "vi"sual mode), was written
>before system() was in a standard library, so it implements it itself:
>
>invoked:
>https://github.com/n-t-roff/ex-1.1/blob/master/ex_unix.c#L82
>
>actual code:
>https://github.com/n-t-roff/ex-1.1/blob/master/ex_unix.c#L105
>
>The functions in that file do some other stuff, but the part that is
>system() is just a few lines of code. And I really believe if system()
>were available, Joy would have just done those things in a wrap of
>system().
>
>Yet even though it is so easy to implement, at some point system()
>_was_ written and now it is a standard part of the library. Why not a
>file copy function?
>
>I think the reason is just plain copying a file, as opposed to doing
>some transformation on a file, is a very rare task in programs. Users
>copy files for backup, "installing", as a first step towards modifying.
>Programs create new, different, files, and don't typically have a use
>for unadulterated copying. Other than the "install" use case, I can't
>think of the need for copying, and install has usually been done in
>shell scripting, where we have `cp`.
>
>I hear someone starting to object "but backups are copies". And there
>are programs that do use ${original}.bak or ${original}~ backup files.
>I have not examined all such cases, but the ones I have the backup is
>not implemented with a copy() function. Instead it is a rename and
>recreate, done when there are changes. The inode, which stays the same
>for a rename, shows that the backup is the original file, and the
>new file has the original name. This is the "doing some transformation"
>thing just slightly obfuscated.
>
>Elijah
>------
>has also seen popen() implemented in a few lines inside old code

Of late I've been doing automated backup programs. IF the
backup is being sent to "the cloud" it's ALWAYS encrypted
before it gets there. That's the smart play, not one microsecond
of exposure.

Being encrypted, such backups are NOT exactly "copies" - and
the encryption methods may NOT respond well to MS-style
filenames. My fix is to copy to a safely-named tempfile, encrypt
and/or zip that, and then use the encryption program to xfer
it to the destination. Once there you change it back to the
original name and impress the originals permissions and such.
The decrypter does the same steps in reverse. Works well.

This is where I discovered that system("mv ...") couldn't always
cope with MS filenames. Not very often, 0.001% of the time, but
still you want it to always be PERFECT. After all, the one file
that DOESN'T 'mv' properly WILL be the critical one you need
for a restoration .. :-)

There ARE alternatives to system() of course, but In my case
I found that rename() did NOT try to interpret escape sequences.
That was the easiest/fastest fix. Saves a few lines of strcat()'s
as well.

As for "fcopy()" ... I was just asking what I thought was a simple
historical question with an easy answer. Apparently not .....

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

<s7ok08$lie$1@dont-email.me>

 copy mid

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

 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: Sat, 15 May 2021 13:57:28 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <s7ok08$lie$1@dont-email.me>
References: <s7esscTUur$2@dont-email.me> <yYedncTUQJMEkgb9nZ2dnUU7-a_NnZ2d@giganews.com> <slrns9mg94.rtj.spamtrap42@one.localnet> <rclm9g5p3fccssosr9228c9q84o2nbsduq@4ax.com> <ig2bnkFu2j3U4@mid.individual.net> <s7h17a$gqv$1@dont-email.me> <3b7p9gtsqsb6h0ijmhjhdugunnsf37836g@4ax.com> <s7jhaa$5jm$1@dont-email.me> <6gsr9glh98d4vf0o8qc9jueb6r9h4bkrjl@4ax.com> <s7ktfd$aip$1@dont-email.me> <0b0s9gpcog1sdc3fcjllq42573s7k7ovg8@4ax.com> <s7lsie$7do$1@dont-email.me> <bmju9gpci1fl2pogc59284tn8raiku1pg7@4ax.com>
Injection-Date: Sat, 15 May 2021 13:57:28 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b8fadee28d89f5a358491009389fa4d4";
logging-data="22094"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+iZutGd7zjJi25czbNMBy"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:9+kVqqNS/AR9z5VlI/aw1EnW7k4=
 by: Rich - Sat, 15 May 2021 13:57 UTC

MSB <Bit15_.us> wrote:
>>You have to 'outthink /bin/sh' if you want to use the system() library
>>call from C to execute mv to move (or possibly copy, depending) a file
>>around.
>
> I think "mv" is really "copy+delete" at heart.

Instead of thinking, why didn't you go check mv's source?

The 'mv' binary will perform a rename() syscall call, if the source and
destination are on the same mounted filesystem.

If the source and destination are not on the same mounted filesystem,
then the 'mv' binary (at least the GNU variant) will instead do a
"copy" operation (open - (read - write in a loop) - close) to perform
the requested 'mv'.

> You CAN access the dir records directly and just change the name,

No, you can't. Only the kernel can do that. All you can do is make a
call to the rename() syscall requesting the kernel make the dir records
updates. At which point the kernel will verify if you have the proper
permissions, and if not, it will refuse to update the dir records.

>>And if you want to use the system() library function for calling any
>>external binary, and if you want to pass strings to that binary as its
>>argc array, you *must* outthink /bin/sh if you want your code to work
>>with all possibilities of filenames.
>
> Um, no ... I will out-think 'mv' by going AROUND it. I'm not
> into masochism.

Again, you still have not understood what folks are telling you. The
problem you describe is not caused by 'mv'. It is caused by /bin/sh
because system() always uses /bin/sh when you use system() from C. It
is /bin/sh you have to out-think, not 'mv'. The 'mv' binary is not the
cause of the issues you've described.

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

<9v31agdlojcbka1mv33m3jqvsijgvm5dub@4ax.com>

 copy mid

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

 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: Sat, 15 May 2021 22:35:19 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Sat, 15 May 2021 23:35:19 -0400
Message-ID: <9v31agdlojcbka1mv33m3jqvsijgvm5dub@4ax.com>
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> <87k0o4z7vj.fsf@LkoBDZeT.terraraq.uk> <q1vr9gpqt5bgprotdb46enc4kk9l3ss4aa@4ax.com> <87wns1ydvx.fsf@LkoBDZeT.terraraq.uk>
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: 51
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-suSTNQUPFuBfuX8gl/AzZuJWNEKFoukwlGCVtLX4ubUnmeY8EFf9DhAl4cyWq7nRM2CUQsdpdNaElpN!W14eNZ2VeU2V8J2oJHmQvieaFn2BCeSyDMo8hQNacAreAwcAnTq5Xf20uIG6JuK95e9Qn0OefS0T!rPQ9aizDqbqInEw=
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: 3491
 by: MSB - Sun, 16 May 2021 03:35 UTC

On Fri, 14 May 2021 08:26:42 +0100, Richard Kettlewell
<invalid@invalid.invalid> wrote:

>MSB <Bit15_.us> writes:
>> On Wed, 12 May 2021 09:14:24 +0100, Richard Kettlewell
>>>Rich <rich@example.invalid> writes:
>>>> Richard Kettlewell <invalid@invalid.invalid> wrote:
>>>>> 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.
>>
>> Nope. Was talking about GCC actually (or Clang, almost the same thing
>> these days).
>>
>> NO fcopy() in GCC.
>
>There’s no fopen() in GCC either. If you want to get into this level of
>detail you should look into how the compiler and library components are
>divided up.

Yes, yes ... a lot of those "functions" are just macros under
the proverbial hood. Don't care really so long as they work.
I'm not a compiler writer ... the only 'compiler' I ever wrote
was ultra-special-purpose - a lot like FORTH, but not with
RPN because I hate RPN.

A sticky point here revolves around what's in the compiler
as opposed to what's in the libraries. "Pure" C, where you
don't even bring in stdio.h, is indeed a very raw, stupid,
language - only about one step better than assembler.
Of course that's why so many libraries were written
so quickly. By the time K&R wrote the book there were
already lots of them.

So, GCC does indeed have fopen() - I used it just today -
but it's a library function, not "core".

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

<pq41aglg0m54f099pan9oksp7j4hjsink7@4ax.com>

 copy mid

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

 copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!feeder5.feed.usenet.farm!feeder1.feed.usenet.farm!feed.usenet.farm!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: Sat, 15 May 2021 23:00:29 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Sun, 16 May 2021 00:00:29 -0400
Message-ID: <pq41aglg0m54f099pan9oksp7j4hjsink7@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> <fphm9glb0f5nrc4klhmcrsjode1e9vluqd@4ax.com> <20210512053317.5969b9d7@nx-74205>
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: 61
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-u1IQ/W4yADXIbVrr8SeKWSs0/iXaDN97EvI4bKTumxwgfi5HXhCAhvKGvOtDYwHuHz96fQFJKt26m9Q!NutPCwEzYlJC6oh6sCTrgs7be9d5OCGQn1QZ1cIHLUMRTJHF1SwzlIVJeP5BlcTPgcP2DaPB2Xgt!JyMJiys5bhUvwB0=
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: 3791
 by: MSB - Sun, 16 May 2021 04:00 UTC

On Wed, 12 May 2021 05:33:17 +0200, Aragorn <thorongil@telenet.be>
wrote:

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

The usual weird economics/politics.

Anyway, I'm glad K wrote 'C' - and even gladder that
so many people put together all those includable
libraries so quickly.

I found an article the other day on how to emulate a PDP-11
on a rPi ... a UNIX disk image is available. Likely a 'c' compiler
is in there somewhere. I think I'll try it, just for funzies. Boxes
with "perfect" orthoganal instruction sets were always a blessing.
The PDP/LSI-11 systems were just GREAT. Limited NOW
of course, but at the time .....

Hmm, I bet the emulator can run several times faster than
any of "K"s hardware :-)
What you CAN'T seem to get anymore is the stuff to
emulate VAX/VMS ... another very good system that
was built with global biz/sci connectionism in mind.

I've used BSD's in various roles over the years. Close
enough to Linux so there's little transition suffering.
Good systems, MAYBE a bit more secure than most
Linux distros ? Can't get OpenBSD to install right on
a KVM/VM though ... dunno what I'm doing wrong ....
and an rPi is even more weird.

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

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

 copy mid

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

 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: Sun, 16 May 2021 10:34:30 +0100
Organization: terraraq NNTP server
Message-ID: <87r1i7xbrt.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> <87k0o4z7vj.fsf@LkoBDZeT.terraraq.uk>
<q1vr9gpqt5bgprotdb46enc4kk9l3ss4aa@4ax.com>
<87wns1ydvx.fsf@LkoBDZeT.terraraq.uk>
<9v31agdlojcbka1mv33m3jqvsijgvm5dub@4ax.com>
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="6619"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:fLvcB+3KWv6cRgj8nqdb89J+N5I=
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 - Sun, 16 May 2021 09:34 UTC

MSB <Bit15_.us> writes:
> On Fri, 14 May 2021 08:26:42 +0100, Richard Kettlewell
>>MSB <Bit15_.us> writes:
>>> Nope. Was talking about GCC actually (or Clang, almost the same thing
>>> these days).
>>>
>>> NO fcopy() in GCC.
>>
>>There’s no fopen() in GCC either. If you want to get into this level of
>>detail you should look into how the compiler and library components are
>>divided up.
>
> Yes, yes ... a lot of those "functions" are just macros under
> the proverbial hood. Don't care really so long as they work.

If you don’t care then why are you so insistent on making nonsensical
statements about them?

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

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

<s7r8rr$rkv$1@dont-email.me>

 copy mid

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

 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: Sun, 16 May 2021 14:05:47 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <s7r8rr$rkv$1@dont-email.me>
References: <mg0c9ghgravcdi2cibr1l53fo1uqdm09lb@4ax.com> <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> <87k0o4z7vj.fsf@LkoBDZeT.terraraq.uk> <q1vr9gpqt5bgprotdb46enc4kk9l3ss4aa@4ax.com> <87wns1ydvx.fsf@LkoBDZeT.terraraq.uk> <9v31agdlojcbka1mv33m3jqvsijgvm5dub@4ax.com> <87r1i7xbrt.fsf@LkoBDZeT.terraraq.uk>
Injection-Date: Sun, 16 May 2021 14:05:47 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="1323e354f9bb231bf09adbaaefec5471";
logging-data="28319"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BJ6EKigqosAPaFC0Zf1qA"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:DseYbSoWD2Ht3P+LEfgFsCK8hew=
 by: Rich - Sun, 16 May 2021 14:05 UTC

Richard Kettlewell <invalid@invalid.invalid> wrote:
> MSB <Bit15_.us> writes:
>> On Fri, 14 May 2021 08:26:42 +0100, Richard Kettlewell
>>>MSB <Bit15_.us> writes:
>>>> Nope. Was talking about GCC actually (or Clang, almost the same thing
>>>> these days).
>>>>
>>>> NO fcopy() in GCC.
>>>
>>>There?s no fopen() in GCC either. If you want to get into this level of
>>>detail you should look into how the compiler and library components are
>>>divided up.
>>
>> Yes, yes ... a lot of those "functions" are just macros under
>> the proverbial hood. Don't care really so long as they work.
>
> If you don?t care then why are you so insistent on making nonsensical
> statements about them?

Two likely reasons are that MSB is very very confused [1] or MSB is
trolling.

The lack of adjustment in the nonsensical statements weighs heavily
towards trolling, because that is *exactly* what a good troll will do.
Present nonsensical statements and then stick with the nonsense as the
victims respond to the trolling.

[1] But then MSB's confusion never seems to change in light of counter
evidence -- most "truly confused" adjust their world view as counter
evidence is presented, making this possibilty seem less likely.

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

<igdqa2F6kgaU1@mid.individual.net>

 copy mid

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

 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: jpstew...@personalprojects.net (John-Paul Stewart)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Sun, 16 May 2021 20:05:22 -0400
Lines: 18
Message-ID: <igdqa2F6kgaU1@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>
<s7dapk$obm$3@dont-email.me> <fphm9glb0f5nrc4klhmcrsjode1e9vluqd@4ax.com>
<20210512053317.5969b9d7@nx-74205>
<pq41aglg0m54f099pan9oksp7j4hjsink7@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net vZ0AIIR19QC17N+ZTiKYEg8IoGLIm7cUm/0UZ5doB6ai/7D4r8
Cancel-Lock: sha1:8nJmW29jU42mXAl8V6ztD06OnXY=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.0
In-Reply-To: <pq41aglg0m54f099pan9oksp7j4hjsink7@4ax.com>
Content-Language: en-CA
 by: John-Paul Stewart - Mon, 17 May 2021 00:05 UTC

On 2021-05-16 12:00 a.m., MSB wrote:
>
> What you CAN'T seem to get anymore is the stuff to
> emulate VAX/VMS

Sure you can. SimH can emulate various models of VAX (and many other
systems). Two different versions are available from:

http://simh.trailing-edge.com/
https://github.com/simh/simh

(It is also pre-packaged in Debian and probably other Linux
distributions, too.)

Lots of people run OpenVMS in SimH. You used to be able to get free
non-commercial licenses through HP's OpenVMS hobbyist program (for
emulators or real hardware). Even without the license PAK you can get
basic functionality.

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

<u9r3agdu2fh8r59f0m43qsl44mj2fv4kvs@4ax.com>

 copy mid

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

 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!goblin2!goblin3!goblin.stu.neva.ru!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 16 May 2021 23:31:36 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Mon, 17 May 2021 00:31:36 -0400
Message-ID: <u9r3agdu2fh8r59f0m43qsl44mj2fv4kvs@4ax.com>
References: <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> <87k0o4z7vj.fsf@LkoBDZeT.terraraq.uk> <q1vr9gpqt5bgprotdb46enc4kk9l3ss4aa@4ax.com> <87wns1ydvx.fsf@LkoBDZeT.terraraq.uk> <9v31agdlojcbka1mv33m3jqvsijgvm5dub@4ax.com> <87r1i7xbrt.fsf@LkoBDZeT.terraraq.uk>
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: 51
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-zrriP8ywLIubI4/tK8pVWBf2uAODzaTKSouIq4tG5wVwkLlqb6GF2sL7z+a+w6Wa1Bdg1DXBiG3XCj9!Fv9OSTsyWoE6TY81sgpxgyM8obOVOO96RHwRTkrAinJDbvSM3hT+0puklGgXhmnG75lu40J/dTDv!EqTENNK+QEOPTwo=
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: 3281
 by: MSB - Mon, 17 May 2021 04:31 UTC

On Sun, 16 May 2021 10:34:30 +0100, Richard Kettlewell
<invalid@invalid.invalid> wrote:

>MSB <Bit15_.us> writes:
>> On Fri, 14 May 2021 08:26:42 +0100, Richard Kettlewell
>>>MSB <Bit15_.us> writes:
>>>> Nope. Was talking about GCC actually (or Clang, almost the same thing
>>>> these days).
>>>>
>>>> NO fcopy() in GCC.
>>>
>>>There’s no fopen() in GCC either. If you want to get into this level of
>>>detail you should look into how the compiler and library components are
>>>divided up.
>>
>> Yes, yes ... a lot of those "functions" are just macros under
>> the proverbial hood. Don't care really so long as they work.
>
>If you don’t care then why are you so insistent on making nonsensical
>statements about them?

Nothing "nonsensical" about it at all. If all the OTHER library
functions, why never a standard fcopy() ?

But at this point I no longer give a shit. Seems there isn't
any real answer. It just got "missed" along the way.

IF you are on any committee deciding on a C-22 standard
PLEASE include one.

It should :

1) Accept "r'/"w" or "rb"/"wb" params ... the latter NOT trying
to "fix" line endings or interpret escape sequences.

2) Create the full directory path, if possible, to the desired
destination target and ensure it is writable.

3) If step 2 is not possible, remember where genuinely
new directories began being created and backtrack,
ie erase the new, hopeless, parts of the path that
were created. In short, clean up.

4) Generate USEFUL error codes, more than just null
or not-null, that can help pinpoint where failure was
encountered. Device didn't exist ? Permissions
issues ? Un-Doable path param provided ?

I don't care if its a messy macro or a real line-by-line
function.

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

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

 copy mid

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

 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: Mon, 17 May 2021 08:14:51 +0100
Organization: terraraq NNTP server
Message-ID: <87lf8dygpg.fsf@LkoBDZeT.terraraq.uk>
References: <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> <87k0o4z7vj.fsf@LkoBDZeT.terraraq.uk>
<q1vr9gpqt5bgprotdb46enc4kk9l3ss4aa@4ax.com>
<87wns1ydvx.fsf@LkoBDZeT.terraraq.uk>
<9v31agdlojcbka1mv33m3jqvsijgvm5dub@4ax.com>
<87r1i7xbrt.fsf@LkoBDZeT.terraraq.uk>
<u9r3agdu2fh8r59f0m43qsl44mj2fv4kvs@4ax.com>
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="8041"; mail-complaints-to="usenet@mantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:X/3vvsh8Nkn8dCBtkjowkYhLPUM=
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, 17 May 2021 07:14 UTC

MSB <Bit15_.us> writes:
> On Sun, 16 May 2021 10:34:30 +0100, Richard Kettlewell
>>MSB <Bit15_.us> writes:
>>> On Fri, 14 May 2021 08:26:42 +0100, Richard Kettlewell
>>>>MSB <Bit15_.us> writes:
>>>>> Nope. Was talking about GCC actually (or Clang, almost the same thing
>>>>> these days).
>>>>>
>>>>> NO fcopy() in GCC.
>>>>
>>>>There’s no fopen() in GCC either. If you want to get into this level of
>>>>detail you should look into how the compiler and library components are
>>>>divided up.
>>>
>>> Yes, yes ... a lot of those "functions" are just macros under
>>> the proverbial hood. Don't care really so long as they work.
>>
>>If you don’t care then why are you so insistent on making nonsensical
>>statements about them?
>
> Nothing "nonsensical" about it at all. If all the OTHER library
> functions, why never a standard fcopy() ?

I mean your claim that fopen is in GCC: for someone who doesn’t carze
about implementation details provided things work, you’re surprisignly
insistent on getting statements about the implementation details wrong.

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

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

<s7t9hd$ic9$1@milena.home.net.it>

 copy mid

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

 copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
From: lsod...@home.net.it (Giovanni)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Mon, 17 May 2021 10:29:33 +0200
Organization: G.Falzoni Home Network
Message-ID: <s7t9hd$ic9$1@milena.home.net.it>
References: <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>
<87k0o4z7vj.fsf@LkoBDZeT.terraraq.uk>
<q1vr9gpqt5bgprotdb46enc4kk9l3ss4aa@4ax.com>
<87wns1ydvx.fsf@LkoBDZeT.terraraq.uk>
<9v31agdlojcbka1mv33m3jqvsijgvm5dub@4ax.com>
<87r1i7xbrt.fsf@LkoBDZeT.terraraq.uk>
<u9r3agdu2fh8r59f0m43qsl44mj2fv4kvs@4ax.com>
Reply-To: gfalzoni@inwind.it
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 40
NNTP-Posting-Host: c616d75d.news.sunsite.dk
X-Trace: 1621240175 news.sunsite.dk 700 gfalzoni@inwind.it/151.48.25.255:39730
X-Complaints-To: staff@sunsite.dk
 by: Giovanni - Mon, 17 May 2021 08:29 UTC

On 05/17/2021 06:31 AM, MSB wrote:

> IF you are on any committee deciding on a C-22 standard
> PLEASE include one.
>
> It should :
>
> 1) Accept "r'/"w" or "rb"/"wb" params ... the latter NOT trying
> to "fix" line endings or interpret escape sequences.
>
> 2) Create the full directory path, if possible, to the desired
> destination target and ensure it is writable.
>
> 3) If step 2 is not possible, remember where genuinely
> new directories began being created and backtrack,
> ie erase the new, hopeless, parts of the path that
> were created. In short, clean up.
>
> 4) Generate USEFUL error codes, more than just null
> or not-null, that can help pinpoint where failure was
> encountered. Device didn't exist ? Permissions
> issues ? Un-Doable path param provided ?
>
> I don't care if its a messy macro or a real line-by-line
> function.
>

Now You got all specs. Write the code and add the compiled object to
your libraries ready to be used whenever You need it.

For me, as I already wrote, it is a function that doesn't need to be in
the standards. The steps You described are built with already standard
functions.

Ciao
Giovanni
--
A computer is like an air conditioner,
it stops working when you open Windows.
< http://giovanni.homelinux.net/ >

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

<g3i6ag1ut9277nnb22einfapuodiu0i692@4ax.com>

 copy mid

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

 copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!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: Tue, 18 May 2021 00:19:25 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Tue, 18 May 2021 01:19:25 -0400
Message-ID: <g3i6ag1ut9277nnb22einfapuodiu0i692@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> <haim9g1ircm44c537m6qu93fsqrgdp152m@4ax.com> <s7hfri$218$1@dont-email.me> <s7hk7v$7g9$1@dont-email.me> <g89p9gp8fh0v9u9f8mhnjjn5cll0rr68u5@4ax.com> <s7iq62$5hn$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-q0PEdczNvEUrUFxt/GXQ16ihwy/86sjZN5C4k2NYaLtER9DelPmTR+B3aZKMBoAmMJuRx55ODgSCu51!j92UH3FxeDdOulO5cvnJ+zo9oR9WLiKutXRpSA6pfVLZ9bB5ESCfhmJ1Crn4lOmnaZ+ENspsi0A8!bPFev/U557iCN6M=
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: 3374
 by: MSB - Tue, 18 May 2021 05:19 UTC

On Thu, 13 May 2021 10:06:10 +0100, The Natural Philosopher
<tnp@invalid.invalid> wrote:

>On 13/05/2021 05:52, MSB wrote:
>> They don't make the PIC 16F84 (or 16C84JW before that)
>> anymore but it should be fun to look into looking into how
>> you make files/directories on I2C FRAMs/EEPROM/SD
>> using naught but assember. Coding that willl give you a buzz,
>> puts the FUN back in computing
>
>I certainly wrote assembler to access a dos formatted disk drive on an
>8086 single board computer. And most of a libc too...

Ah ... someone from the Bad Old Days - when if you had
to do it you had to Do It Yourself :-)

I came in a bit before the 8088 ... Z80's/6800s/6502s
some PDP/LSI-11s.

I remember porting a FORTRAN app into IBM BASIC for
a guy who loved Fourier transforms. Was STILL way too
slow even when you used the BASCOM compiler. Bought
one of those expensive 8087 chips - remember when they
were separate chips ? - and wrote some DATA statments
for BASIC that sent stuff to the chip and got the results.
50X faster ... kind of shocked me at the time. BUT, for a
year or two, there were no languages/libraries that would
support the math processor. Turbo Pascal finally started
supporting it - HUGE improvement in many dimensions.

Microcontrollers are even more of a buzz because of
the tiny ROM/RAM aspects. There are Arduino libraries
now for doing FAT format SD cards, but before that you
had to do it the HARD way. And before that, no SD
cards .... figure out how to do it in eeprom or fRam
chips (usually I2C) ....... I really like fRam, fast, you
don't need long delays.

The modern environments are MUCH nicer - but I wonder
if they discourage the real low-down practical programming.
Of course it's STILL being done, out of sight, but todays
programmers never have to think about it. The people
who do NASA space probes ... they are still one with
the hardware. A very rare breed however.

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

<s8013h$qn7$1@dont-email.me>

 copy mid

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

 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, 18 May 2021 10:24:00 +0100
Organization: A little, after lunch
Lines: 109
Message-ID: <s8013h$qn7$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>
<s7drhh$l8j$1@dont-email.me> <haim9g1ircm44c537m6qu93fsqrgdp152m@4ax.com>
<s7hfri$218$1@dont-email.me> <s7hk7v$7g9$1@dont-email.me>
<g89p9gp8fh0v9u9f8mhnjjn5cll0rr68u5@4ax.com> <s7iq62$5hn$1@dont-email.me>
<g3i6ag1ut9277nnb22einfapuodiu0i692@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 18 May 2021 09:24:01 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2c18eb1fb0526a7e094b4f6c6dbb7167";
logging-data="27367"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18SM8y09e8KJZ9N6mE8tsu0/5vZOgU5bK4="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:xZL0E6Us6tbXAZMqEDKaVjGOef0=
In-Reply-To: <g3i6ag1ut9277nnb22einfapuodiu0i692@4ax.com>
Content-Language: en-GB
 by: The Natural Philosop - Tue, 18 May 2021 09:24 UTC

On 18/05/2021 06:19, MSB wrote:
> On Thu, 13 May 2021 10:06:10 +0100, The Natural Philosopher
> <tnp@invalid.invalid> wrote:
>
>> On 13/05/2021 05:52, MSB wrote:
>>> They don't make the PIC 16F84 (or 16C84JW before that)
>>> anymore but it should be fun to look into looking into how
>>> you make files/directories on I2C FRAMs/EEPROM/SD
>>> using naught but assember. Coding that willl give you a buzz,
>>> puts the FUN back in computing
>>
>> I certainly wrote assembler to access a dos formatted disk drive on an
>> 8086 single board computer. And most of a libc too...
>
> Ah ... someone from the Bad Old Days - when if you had
> to do it you had to Do It Yourself :-)

No. It was my job.

Single board 8086 computer that was the master controller for a
minicomputer.

It needed a BIOS. Project manager also wanted FORTH and an 8" floppy
drive on it, too. Threw me about 100 pages of densely *printed*
assembler 'that's a FORTH interpreter. Key it in'

>
> I came in a bit before the 8088 ... Z80's/6800s/6502s
> some PDP/LSI-11s.
>
> I remember porting a FORTRAN app into IBM BASIC for
> a guy who loved Fourier transforms. Was STILL way too
> slow even when you used the BASCOM compiler. Bought
> one of those expensive 8087 chips - remember when they
> were separate chips ? - and wrote some DATA statments
> for BASIC that sent stuff to the chip and got the results.
> 50X faster ... kind of shocked me at the time. BUT, for a
> year or two, there were no languages/libraries that would
> support the math processor. Turbo Pascal finally started
> supporting it - HUGE improvement in many dimensions.

Hah. That reminds me of a funny story that became a watchword. Early
days of 86 Unix - Interactive Unix 386 - a sysV port...and it wouldn't
install.

A call to the UK importer and support line netted, in an extremely thick
subcontinental accent

"The BIOS - she is incompatible"

There was a strong smell of bovine excrement about that, so I waited
till the West Coast was at work and phoned California.

"How far is it getting into the boot process...?" I told him "Hang on
while I get the installation source... Ok....its looking for the maths
coprocessor." "There isn't one" "Have you got the jumper that tells it
there isn't one in the right place"..."What jumper"..."you need to check
the motherboard manual"..."Are you sure that's the problem" "Of course,
I wrote the installation code".

Well the PC supplier was only minutes away so I went and told him the
story and he chuckled 'Windows doesn't check it, because it doesn't use
it, so we never bother to put the jumper on'

From that day onwards if we ever brought a faulty PC back to him he
would say "The BIOS, she is incompatible?"

>
> Microcontrollers are even more of a buzz because of
> the tiny ROM/RAM aspects. There are Arduino libraries
> now for doing FAT format SD cards, but before that you
> had to do it the HARD way. And before that, no SD
> cards .... figure out how to do it in eeprom or fRam
> chips (usually I2C) ....... I really like fRam, fast, you
> don't need long delays.
> #
We did it with an 8086 in circuit emulator. Made out of ECL. In a sweaty
basement. One day the emulator packed up.
I read the manual after having a hunch "this emulator is guaranteed up
to 27°C ambient."

It was 28°C.

The air conditioning we have been pleading for for 6 weeks turned up two
days later..

Once the emulator code worked we programmed an EEPROM.

> The modern environments are MUCH nicer - but I wonder
> if they discourage the real low-down practical programming.
> Of course it's STILL being done, out of sight, but todays
> programmers never have to think about it. The people
> who do NASA space probes ... they are still one with
> the hardware. A very rare breed however.
>
People who write device drivers still code that low level - registers
and IO busses and hardware interrupts.

Its different sorts of programming.

Bare metal versus application.

--
How fortunate for governments that the people they administer don't think.

Adolf Hitler

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

<lsjbaghs0f5qbk0m75tn1hsb805qlsf6p6@4ax.com>

 copy mid

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

 copy link   Newsgroups: comp.os.linux.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!news.uzoreto.com!tr3.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, 19 May 2021 22:00:50 -0500
From: Bit15_...@nowhere (MSB)
Newsgroups: comp.os.linux.misc
Subject: Re: Why No "fcopy()" in 'C' ?
Date: Wed, 19 May 2021 23:00:50 -0400
Message-ID: <lsjbaghs0f5qbk0m75tn1hsb805qlsf6p6@4ax.com>
References: <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> <87k0o4z7vj.fsf@LkoBDZeT.terraraq.uk> <q1vr9gpqt5bgprotdb46enc4kk9l3ss4aa@4ax.com> <87wns1ydvx.fsf@LkoBDZeT.terraraq.uk> <9v31agdlojcbka1mv33m3jqvsijgvm5dub@4ax.com> <87r1i7xbrt.fsf@LkoBDZeT.terraraq.uk> <u9r3agdu2fh8r59f0m43qsl44mj2fv4kvs@4ax.com> <s7t9hd$ic9$1@milena.home.net.it>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 51
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 98.77.166.178
X-Trace: sv3-0FShoVO2obEQeCy18DfZd/iz9ndx0giIew5Q+ZluKJ/8QlFGOLKwCVUkCGyrd9mQJIDO4SjGElJhdFH!NcabM3RhOpVUv/lA3pSK6pca0fJ1wDyUBG0qAB7zH2wczTqGJMiLh9r/yXt+v/LRt1t8iVmHr+wr!qCv18FyIEZ4Fx0Q=
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: 3132
 by: MSB - Thu, 20 May 2021 03:00 UTC

On Mon, 17 May 2021 10:29:33 +0200, Giovanni <lsodgf0@home.net.it>
wrote:

>On 05/17/2021 06:31 AM, MSB wrote:
>
>> IF you are on any committee deciding on a C-22 standard
>> PLEASE include one.
>>
>> It should :
>>
>> 1) Accept "r'/"w" or "rb"/"wb" params ... the latter NOT trying
>> to "fix" line endings or interpret escape sequences.
>>
>> 2) Create the full directory path, if possible, to the desired
>> destination target and ensure it is writable.
>>
>> 3) If step 2 is not possible, remember where genuinely
>> new directories began being created and backtrack,
>> ie erase the new, hopeless, parts of the path that
>> were created. In short, clean up.
>>
>> 4) Generate USEFUL error codes, more than just null
>> or not-null, that can help pinpoint where failure was
>> encountered. Device didn't exist ? Permissions
>> issues ? Un-Doable path param provided ?
>>
>> I don't care if its a messy macro or a real line-by-line
>> function.
>>
>
>Now You got all specs. Write the code and add the compiled object to
>your libraries ready to be used whenever You need it.

I have, and use it often. But it's not "standard" like 'printf()'
or a hundred others.

Oh well ... I was just wondering WHY it wasn't
standardized along with printf() and so many others.
Seems there is no "THE Answer" and the only person
who might have provided one is long dead. So, it is
what it is.

>For me, as I already wrote, it is a function that doesn't need to be in
>the standards. The steps You described are built with already standard
>functions.
>
>Ciao
>Giovanni

Pages:1234
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor