Tinche / aiofiles

File support for asyncio
Apache License 2.0
2.66k stars 150 forks source link

Error creating file #108

Open andrea-cassioli-maersk opened 3 years ago

andrea-cassioli-maersk commented 3 years ago

I am implementing a liveness based on a file timestamp, using a simple code as follow

 async with aiofiles.open(liveness_file_path, 'w'):
                    pass

I am only interested in the existence of the file, so I am not going to write any data on it. This happens every minutes, but once every now and then I get

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/liveness'

The file and folder is always the same, and that file is not used for any other purpose. So I am a bit puzzled on why this happen. Any clue?