python - File in folder created before folder itself -
i have got interesting behavior while reading folder , file in folder creation times. explain this?
creating folder
os.makedirs(version_dir+test_name)
running sub-process in folder , create result file there
err_code = common.run_proc(common.get_root_dir() + test_name, custom_path_str=version_dir+test_name)
then there script read creation time of folder , result file using os.get.getmtime
, apparently creation (as understood docs modification time) time of file within folder 1403197510.1
, folder 1403197510.19
.
so basicly have created file in not existing folder. how work or why have such strange output?
what believe seeing fact windows modify folders represent files within.
so happens:
- os.makedirs() creates folder, gives time of modification (with os.path.getmtime). e.g. 1403197510.0
- write file folder, gives time of modification (with os.path.getmtime). e.g. 1403197510.1
- windows updates folder, gives modification time (with os.path.getmtime). e.g. 1403197510.19
Comments
Post a Comment