Async-std: Feature Request: fs::remove_all

Created on 30 Jan 2020  路  3Comments  路  Source: async-rs/async-std

Would having the following function be a good addition to this library?

/// This function will either remove the file specified at `path` or remove the
/// directory and all of its contents specified at `path`
pub async fn remove_all<P: AsRef<Path>>(path: P) -> io::Result<()> { ... }

Most helpful comment

I think that this should be in the library and not outside of it because it fits very much into the other remove_* functions. Though I can definitely understand not wanting to add it if the std doesn't have it. I wonder if they might add it.... (I'll ask).

All 3 comments

Hi, thanks for the suggestion!

In general, async-std tries to track rusts libstd as close as possible. libstd doesn't provide remove_all.

Is there any particular reasons this needs to be in the library and cannot be implemented outside of it?

I think that this should be in the library and not outside of it because it fits very much into the other remove_* functions. Though I can definitely understand not wanting to add it if the std doesn't have it. I wonder if they might add it.... (I'll ask).

@Nokel81 I agree that it is a reasonable addition to libstd. I'll leave this issue open for reference.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

imtsuki picture imtsuki  路  5Comments

kornelski picture kornelski  路  5Comments

cole-acepph picture cole-acepph  路  5Comments

Licenser picture Licenser  路  8Comments

matthewrobertbell picture matthewrobertbell  路  7Comments