[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
If I check the last modification time of a file in Python, move

You are currently reading a thread in /g/ - Technology

Thread replies: 10
Thread images: 1
File: python logo.jpg (8 KB, 225x225) Image search: [Google]
python logo.jpg
8 KB, 225x225
If I check the last modification time of a file in Python, move the file to another hard drive with the same file system and check the time again, it returns a different value.

Same os
Same computer
Same file

What is going on?
>>
>>55491862
what OS
what file system
post code
>>
>>55491862
>move the file to another hard drive
You're writing the file in another hard drive, not just moving to the same one.

Of course it will return another value.
>>
>>55491890
Win 7
NTFS

os.path.getmtime()
>>
>>55491921
I want to compare the modification timestamp, not the creation timestamp.
>>
>>55491946
Different file system
Different os
>>
>>55491946
round it. filesystems can have issues with microseconds
>>
>>55492187
The difference is over a whole second though. But why would the modification time be affected at all? I'm not modifying the file.
>>
>>55491983
>he thinks creation is not a modification
>>
>>55492445
It's not. It's a modification of the file itself, at least it should be.

By the way, I fixed the issue according to >>55492187 's advice. I just added an error margin of 5 seconds to my calculations.

I'm a genius.
Thread replies: 10
Thread images: 1

[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK