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)
Does uPython set ST_MTIME on file creation?
Re: Does uPython set ST_MTIME on file creation?
Which board are you using?
The timestamps seem to be modified on a pyboard:
The timestamps seem to be modified on a pyboard:
Code: Select all
MicroPython v1.9.3-521-gd6cf5c6 on 2018-04-23; PYBv1.1 with STM32F405RG
Type "help()" for more information.
>>> rtc = pyb.RTC()
>>> rtc.datetime()
(2018, 5, 14, 1, 9, 57, 30, 200)
>>> open('delme2.del', 'w')
<io.TextIOWrapper 20003380>
>>> rtc.datetime((2010, 5, 11, 4, 21, 10, 39, 146))
>>> open('delme3.del', 'w')
<io.TextIOWrapper 20003a20>
>>> rtc.datetime()
(2010, 5, 11, 4, 21, 10, 54, 202)
>>> import os
>>> os.stat('delme2.del')
(32768, 0, 0, 0, 0, 0, 0, 579607056, 579607056, 579607056)
>>> os.stat('delme3.del')
(32768, 0, 0, 0, 0, 0, 0, 326927444, 326927444, 326927444)
>>>
Re: Does uPython set ST_MTIME on file creation?
Odd, I'm using PyBoard 1.1, will try again copy pasting your code and report versions more carefully. Thanks.