async-rs / async-rs/async-std

Question regarding create_dir_all()

Open
#990 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.1k
Forks
339
PR merge metrics
No merged PRs in 30d

Description

I have a question regarding [`async_std::fs::create_dir_all()`](https://docs.rs/async-std/1.10.0/async_std/fs/fn.create_dir_all.html), I hope that you can answer it here.

I know that if I try to use [`create_dir_all()`](https://docs.rs/async-std/1.10.0/async_std/fs/fn.create_dir_all.html) to create the exact same path from multiple independent tasks at the same time that I risk an error being returned, but what happens if I have the same parent directory with multiple independent subdirectories all of which are being created at the same time, but from independent tasks? E.g.:

```
/tmp/foo/a
/tmp/foo/b
/tmp/foo/c
```

are all being created concurrently, from independent tasks, and initially `foo` doesn't exist. Will this result in an error being returned?

Contributor guide

Open the contributing guide

Research direction

Start with the async_std::fs::create_dir_all() entry point and its linked docs.rs documentation. Check the implementation and relevant filesystem behavior to determine whether concurrent creation of distinct subdirectories under a missing shared parent can return an error. Done means providing a definitive answer and documenting the behavior if the project expects a documentation change.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.