Friday, November 4, 2022

Digest for comp.lang.c++@googlegroups.com - 6 updates in 2 topics

Keith Thompson <Keith.S.Thompson+u@gmail.com>: Nov 04 03:05PM -0700

> uniqueness but I like adding microseconds as a guarantee. Something
> like
> uniquac1.out.009.20181972.20220912
 
An alternative is to keep a counter, incremented for each generated file
name, and append it to the file name, perhaps resetting to 0 when the
seconds count advances. If your only requirement is uniqueness, that
should be good enough.
 
Digression: I remember an implementation of gettimeofday() that did
something like that (on SunOS, maybe?). The system clock had a
resolution of 0.01 second, so the value of tv_usec on successive calls
might be:
420000
420001
420002
430000
430001
430002
...
I don't remember whether the implicit counter was per-process or
system-wide.
 
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */
Lynn McGuire <lynnmcguire5@gmail.com>: Nov 04 05:35PM -0500

On 11/4/2022 5:05 PM, Keith Thompson wrote:
> ...
> I don't remember whether the implicit counter was per-process or
> system-wide.
 
The problem is multiple instances of the same program creating the same
name files.
 
Lynn
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Nov 04 03:56PM -0700

On 11/4/2022 3:35 PM, Lynn McGuire wrote:
>> system-wide.
 
> The problem is multiple instances of the same program creating the same
> name files.
 
Prepend the file names with the PID? Something to make it unique.
Perhaps a SHA2-HMAC or something.
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Nov 04 04:15PM -0700

>> system-wide.
 
> The problem is multiple instances of the same program creating the
> same name files.
 
You could incorporate the process id into the file name.
 
There's no truly portable way to do that, but one solution for POSIX and
another for Windows is likely to be good enough.
 
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */
Lynn McGuire <lynnmcguire5@gmail.com>: Nov 04 03:17PM -0500

"Google takes on C++ technical debt with new successor language: Carbon"

https://sdtimes.com/software-development/google-takes-on-c-technical-debt-with-new-successor-language-carbon/
 
Good night, these people are prolific.
 
Lynn
Bonita Montero <Bonita.Montero@gmail.com>: Nov 04 09:20PM +0100

Am 04.11.2022 um 21:17 schrieb Lynn McGuire:
 
> "Google takes on C++ technical debt with new successor language: Carbon"
> https://sdtimes.com/software-development/google-takes-on-c-technical-debt-with-new-successor-language-carbon/
> Good night, these people are prolific.
 
I can handle C++ and I don't need an easier C++.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: