From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Windows file timestamp converted to local time Date: Tue, 17 Oct 2023 09:25:03 +0200 Organization: A noiseless patient Spider Message-ID: References: <262bea8c-57ff-480e-b5aa-da94f0436e98n@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 17 Oct 2023 07:25:02 -0000 (UTC) Injection-Info: dont-email.me; posting-host="f375846712243c1999d70938de18ff59"; logging-data="2977888"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/krGyvc7KExGtyWHmFONcM51u9CW/QHs8=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:oEMQ8mb1Ef2OchB8QzFJMN8fbqo= Content-Language: en-US In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:65797 List-Id: On 2023-10-16 20: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; If I correctly interpret the description, OS_Time is FILETIME under Windows, i.e. 64-bit value. https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime As for implementation it likely calls to GetFileTime after obtaining a handle to the file. https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfiletime -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de