Best way to delete a file asynchronously in Python

2019-05-15 01:00发布

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 ??

1条回答
Fickle 薄情
2楼-- · 2019-05-15 01:41

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.

查看更多
登录 后发表回答