pub async fn create_directory(
    parent: &DirectoryProxy,
    path: &str,
    flags: u32,
) -> Result<DirectoryProxy, OpenError> {
    let (dir, server_end) =
        fidl::endpoints::create_proxy::<DirectoryMarker>().map_err(OpenError::CreateProxy)?;

    // NB: POSIX does not allow open(2) to create dirs, but fuchsia.io does not have an equivalent
    // of mkdir(2), so on Fuchsia we're expected to call open on a DirectoryMarker with (flags &
    // OPEN_FLAG_CREATE) set.
    // (mode & MODE_TYPE_DIRECTORY) is also required, although it is redundant (the fact that we
    // opened a DirectoryMarker is the main way that the underlying filesystem understands our
    // intention.)
    let flags = flags
        | fidl_fuchsia_io::OPEN_FLAG_CREATE
        | fidl_fuchsia_io::OPEN_FLAG_DIRECTORY
        | fidl_fuchsia_io::OPEN_FLAG_DESCRIBE;
    let mode = fidl_fuchsia_io::MODE_TYPE_DIRECTORY;

    parent
        .open(flags, mode, path, ServerEnd::new(server_end.into_channel()))
        .map_err(OpenError::SendOpenRequest)?;

    // wait for the directory to open and report success.
    node::verify_directory_describe_event(dir).await
}
/// Creates a directory named `path` within the `parent` directory.
Creates a directory named `path` within the `parent` directory.
Creates a directory named ` path ` within the ` parent ` directory .
pub async fn create_directory(
    parent: &DirectoryProxy,
    path: &str,
    flags: u32,
) -> Result<DirectoryProxy, OpenError> {
    let (dir, server_end) =
        fidl::endpoints::create_proxy::<DirectoryMarker>().map_err(OpenError::CreateProxy)?;
    // NB: POSIX does not allow open(2) to create dirs, but fuchsia.io does not have an equivalent
    // of mkdir(2), so on Fuchsia we're expected to call open on a DirectoryMarker with (flags &
    // OPEN_FLAG_CREATE) set.
    // (mode & MODE_TYPE_DIRECTORY) is also required, although it is redundant (the fact that we
    // opened a DirectoryMarker is the main way that the underlying filesystem understands our
    // intention.)
    let flags = flags
        | fidl_fuchsia_io::OPEN_FLAG_CREATE
        | fidl_fuchsia_io::OPEN_FLAG_DIRECTORY
        | fidl_fuchsia_io::OPEN_FLAG_DESCRIBE;
    let mode = fidl_fuchsia_io::MODE_TYPE_DIRECTORY;
    parent
        .open(flags, mode, path, ServerEnd::new(server_end.into_channel()))
        .map_err(OpenError::SendOpenRequest)?;
    // wait for the directory to open and report success.
    node::verify_directory_describe_event(dir).await
}
pub async fn create_directory ( parent : & DirectoryProxy , path : & str , flags : u32 , ) -> Result < DirectoryProxy , OpenError > { let ( dir , server_end ) = fidl :: endpoints :: create_proxy :: < DirectoryMarker > ( ) . map_err ( OpenError :: CreateProxy ) ? ; // NB: POSIX does not allow open(2) to create dirs, but fuchsia.io does not have an equivalent // of mkdir(2), so on Fuchsia we're expected to call open on a DirectoryMarker with (flags & // OPEN_FLAG_CREATE) set. // (mode & MODE_TYPE_DIRECTORY) is also required, although it is redundant (the fact that we // opened a DirectoryMarker is the main way that the underlying filesystem understands our // intention.) let flags = flags | fidl_fuchsia_io :: OPEN_FLAG_CREATE | fidl_fuchsia_io :: OPEN_FLAG_DIRECTORY | fidl_fuchsia_io :: OPEN_FLAG_DESCRIBE ; let mode = fidl_fuchsia_io :: MODE_TYPE_DIRECTORY ; parent . open ( flags , mode , path , ServerEnd :: new ( server_end . into_channel ( ) ) ) . map_err ( OpenError :: SendOpenRequest ) ? ; // wait for the directory to open and report success. node :: verify_directory_describe_event ( dir ) . await }
Creates a directory named `path` within the `parent` directory.
Creates a directory named ` path ` within the ` parent ` directory .
parent
&DirectoryProxy
path
&str
flags
u32
parent
&DirectoryProxy
path
&str
flags
u32