3

There are posts from several (4) years ago showing how to use Threads to delete a file asynchronously.

Things have moved on though, what with aiofiles etc. Its all a bit of a maze, so am I missing a current, elegant method to achieve this without Threading ??

Chanonry
  • 323
  • 3
  • 17

1 Answers1

3

There's no way to work with file I/O asynchronously without threads due to operation systems limits. It's not related to Python or asyncio at all.

The best way to work with file I/O asynchronously now - is aiofiles library usage.

Andrew Svetlov
  • 15,801
  • 7
  • 63
  • 67
Mikhail Gerasimov
  • 32,558
  • 15
  • 103
  • 148