4

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
  • 423
  • 7
  • 19

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
  • 16,730
  • 8
  • 66
  • 69
Mikhail Gerasimov
  • 36,989
  • 16
  • 116
  • 159