From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:1882:: with SMTP id 124mr46154itr.0.1542668189922; Mon, 19 Nov 2018 14:56:29 -0800 (PST) X-Received: by 2002:a9d:2c22:: with SMTP id f31mr312100otb.4.1542668189784; Mon, 19 Nov 2018 14:56:29 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.216.MISMATCH!q69no645635itb.0!news-out.google.com!v141ni1010ita.0!nntp.google.com!z5-v6no642984ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 19 Nov 2018 14:56:29 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=79.94.114.188; posting-account=O1Kt4QoAAABKYAjrg-cGai_vZLnN2LEw NNTP-Posting-Host: 79.94.114.188 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0577e947-d691-4b81-aca6-b2e86bbef634@googlegroups.com> Subject: GNAT Modification_Time limitation From: Lionel Draghi Injection-Date: Mon, 19 Nov 2018 22:56:29 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:54843 Date: 2018-11-19T14:56:29-08:00 List-Id: I am coding a kind of make application, that depends on file's time tag (thanks to Ada.Directories.Modification_Time), and on Ada.Calendar.Clock, both returning Ada.Calendar.Time. Unfortunately, I came across a GNAT limitation in the Modification_Time implementation on Linux : sub-second are ignored, and Modification_Time returns > Time_Of (Year, Month, Day, Hour, Minute, Second, 0.0); So, at the same time Clock returns 2018-10-29 20:36:01.47 while Modification_Time returns 2018-10-29 20:36:01.00 This prevents me from knowing if a file is modified before or after certain time, and thus undermine my efforts. My workaround was to impair also Clock precision, with an ugly rounding: > Time := Ada.Calendar.Clock; > New_Time := Time_Of > (Year => Year (Time), > Month => Month (Time), > Day => Day (Time), > Seconds => Day_Duration (Float'Floor (Float (Seconds (Time))))); But that's not a correct solution either : I have to order lots of file creation, and having all files created during the same second returning the same time tag also prevent my algorithm from properly working. Any workaround to get a precise file time tag? Or to compare file's time tag with Clock? Thanks, -- Lionel