Does uPython set ST_MTIME on file creation?
Posted: Fri May 11, 2018 9:31 pm
My test below (uPython 1.9.x) suggests not, just wanted to confirm, thanks.
>>> rtc.datetime()
(2018, 5, 11, 4, 21, 10, 39, 146)
>>> open('delme2.del', 'w')
<io.TextIOWrapper 2000e100>
>>> rtc.datetime((2010, 5, 11, 4, 21, 10, 39, 146))
>>> open('delme3.del', 'w')
<io.TextIOWrapper 2000e270>
>>> rtc.datetime()
(2010, 5, 11, 4, 21, 10, 48, 20)
>>> os.stat('delme2.del')
(32768, 0, 0, 0, 0, 0, 0, 12873600, 12873600, 12873600)
>>> os.stat('delme3.del')
(32768, 0, 0, 0, 0, 0, 0, 12873600, 12873600, 12873600)
>>> rtc.datetime()
(2018, 5, 11, 4, 21, 10, 39, 146)
>>> open('delme2.del', 'w')
<io.TextIOWrapper 2000e100>
>>> rtc.datetime((2010, 5, 11, 4, 21, 10, 39, 146))
>>> open('delme3.del', 'w')
<io.TextIOWrapper 2000e270>
>>> rtc.datetime()
(2010, 5, 11, 4, 21, 10, 48, 20)
>>> os.stat('delme2.del')
(32768, 0, 0, 0, 0, 0, 0, 12873600, 12873600, 12873600)
>>> os.stat('delme3.del')
(32768, 0, 0, 0, 0, 0, 0, 12873600, 12873600, 12873600)