This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gopeshsingh
Recipients gopeshsingh
Date 2021-08-26.06:34:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629959698.42.0.950387812936.issue45009@roundup.psfhosted.org>
In-reply-to
Content
I am trying to get Last modified dates of Folders and Files mounted on Azure Databricks.
I am using following Code:

```
root_dir = "/dbfs/mnt/ADLS1/LANDING/parent"

def get_directories(root_dir):

    for child in Path(root_dir).iterdir():

        if child.is_file():
            print(child, datetime.fromtimestamp(getmtime(child)).date())
      
        else:
            print(child, datetime.fromtimestamp(getmtime(child)).date())
            get_directories(child)
```
The issue is that it is giving wrong dates for some folders.
When I put a wait time of 1 second (time.sleep(.000005)) for each iteration, it gives correct results.
Otherwise, it sometimes give current date or date of folder listed from last iteration.

Seems, when the processing is fast, it is not able to pick correct modified date.

I have explained this issue on other portal: 
https://stackoverflow.com/questions/68917983/get-last-modified-date-of-folders-and-files-in-azure-databricks
History
Date User Action Args
2021-08-26 06:34:58gopeshsinghsetrecipients: + gopeshsingh
2021-08-26 06:34:58gopeshsinghsetmessageid: <1629959698.42.0.950387812936.issue45009@roundup.psfhosted.org>
2021-08-26 06:34:58gopeshsinghlinkissue45009 messages
2021-08-26 06:34:58gopeshsinghcreate