comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Windows file timestamp converted to local time
Date: Mon, 16 Oct 2023 21:39:09 -0500	[thread overview]
Message-ID: <ugks3g$2mvfi$1@dont-email.me> (raw)
In-Reply-To: kp5eucFogqpU1@mid.individual.net

"Niklas Holsti" <niklas.holsti@tidorum.invalid> wrote in message 
news:kp5eucFogqpU1@mid.individual.net...
> On 2023-10-16 21:35, Matt Borchers wrote:
>> Below is the function from System.OS_Lib.
>> Does anybody know where the C implementation can be found?
>> Does anybody know where the C implementation of "localtime" is found?
>>
>>     function File_Time_Stamp (Name : C_File_Name) return OS_Time is
>>        function File_Time (Name : Address) return OS_Time;
>>        pragma Import (C, File_Time, "__gnat_file_time_name");
>>     begin
>>        return File_Time (Name);
>>     end File_Time_Stamp;
>
>
> (This question seems to be a follow-up ("Re:") to some earlier post, but 
> my newsreader does not seem to find or show that earlier post.)
>
> What is the problem?
>
> Have you tried using the standard Ada services: 
> Ada.Directories.Modification_Time and 
> Ada.Calendar.Time_Zones.Local_Time_Offset?

...as those will work on (almost) any target system, while the actual 
implementation is going to be rather OS-dependent. And there never is a good 
reason to use a GNAT-only (or any compiler-specific, for any compiler) 
facility when there is an equivalent standard facility. Most of those 
facilities pre-date the Ada ones.

                Randy.


  reply	other threads:[~2023-10-17  2:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <262bea8c-57ff-480e-b5aa-da94f0436e98n@googlegroups.com>
2023-10-16 18:35 ` Windows file timestamp converted to local time Matt Borchers
2023-10-16 18:49   ` Niklas Holsti
2023-10-17  2:39     ` Randy Brukardt [this message]
2023-10-17 14:13     ` Matt Borchers
2023-10-17 16:28       ` Niklas Holsti
2023-10-17 16:35         ` Simon Wright
2023-10-16 19:14   ` Simon Wright
2023-10-17  7:25   ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox