Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #121451

Re: Everything without Posix-APIs !

From Paavo Helde <eesnimi@osa.pri.ee>
Newsgroups comp.lang.c++
Subject Re: Everything without Posix-APIs !
Date 2025-01-18 17:28 +0200
Organization A noiseless patient Spider
Message-ID <vmghb5$ug91$1@dont-email.me> (permalink)
References <vmcubv$3ufnp$1@raubtier-asyl.eternal-september.org> <vmfu86$oede$1@dont-email.me> <vmg6pi$qq3r$2@raubtier-asyl.eternal-september.org>

Show all headers | View raw


On 18.01.2025 14:28, Bonita Montero wrote:
> Am 18.01.2025 um 11:02 schrieb Muttley@dastardlyhq.com:
>> On Fri, 17 Jan 2025 07:46:25 +0100
>> Bonita Montero <Bonita.Montero@gmail.com> gabbled:
>>> I'm developing a little tool to grep from a process address space
>>> with a regex-delimiter for the start and end (both included in the
>>> result). Therefore I needed to enumerate the process-IDs whose exe-
>>> cutable paths matches a certain regex. This is the code:
>>>
>>>
>>> Everything is done without Posix-APIs but with pure C++ !
>>
>> Given its simply iterating a directory I'm not sure whats so amazing 
>> about it.
>> However, thank you for reminding me about from_chars(), I'd forgotten 
>> all about that function. Could have used it recently instead of strtol().
>>
> 
> from_chars is more flexible because it returns where it has ended
> parsing. That's necessary to detect syntax-errors because there
> might be superfluous chars beyond the end.

strtol() also returns where it has ended parsing, so there is no 
difference here.

Alas, strtol() uses the current locale which might potentially cause 
surprises, at least in theory. std::from_chars() is definitely better in 
this regard.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Everything without Posix-APIs ! Bonita Montero <Bonita.Montero@gmail.com> - 2025-01-17 07:46 +0100
  Re: Everything without Posix-APIs ! Muttley@dastardlyhq.com - 2025-01-18 10:02 +0000
    Re: Everything without Posix-APIs ! Bonita Montero <Bonita.Montero@gmail.com> - 2025-01-18 13:28 +0100
      Re: Everything without Posix-APIs ! Paavo Helde <eesnimi@osa.pri.ee> - 2025-01-18 17:28 +0200
      Re: Everything without Posix-APIs ! scott@slp53.sl.home (Scott Lurndal) - 2025-01-18 16:41 +0000
      Re: Everything without Posix-APIs ! wij <wyniijj5@gmail.com> - 2025-01-19 09:35 +0800
    Re: Everything without Posix-APIs ! scott@slp53.sl.home (Scott Lurndal) - 2025-01-18 16:38 +0000
      Re: Everything without Posix-APIs ! Paavo Helde <eesnimi@osa.pri.ee> - 2025-01-18 19:11 +0200
        Re: Everything without Posix-APIs ! scott@slp53.sl.home (Scott Lurndal) - 2025-01-18 17:21 +0000

csiph-web