Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006289OCamlOCaml standard librarypublic2014-01-08 13:022014-01-09 15:58
ReporterChristophe Troestler 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version4.01.0 
Target VersionFixed in Version 
Summary0006289: Unix.utimes with 0.0
DescriptionThe documentation says "A time of [0.0] is interpreted as the current time". However the implementation makes the test

    if (times.actime || times.modtime)

or

      if (tv[0].tv_sec || tv[1].tv_sec)

which has two unfortunate consequences
- If one time is 0.0 and the other one is not, 0.0 is not interpreted as the current time.
- If the time is 0.1 or any value in [0,1[ (thus not 0.0), it is interpreted as 0 because it is rounded down before the test.

Also, since the name is Unix.utimes and not Unix.utime, one should maybe prefer the utimes function (with its sub-second resolution) over the utime one when both are available.

Finally, one may also question the benefit of this convention. Maybe a function Unix.utimes_now would be a better replacement (Unix.utimes would thus have no exceptional behavior).
Additional InformationSee http://roscidus.com/blog/blog/2014/01/07/ocaml-the-bugs-so-far/ [^]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2014-01-08 13:02 Christophe Troestler New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker