fn resource_file_channel(name: &str) -> Result<zx::Channel, Error> {
    // We try two paths here, because normal components see their config package data resources in
    // /pkg/data and shell tools see them in /pkgfs/packages/config-data/0/data/<pkg>.
    Ok(zx::Channel::from(fdio::transfer_fd(
        File::open(format!("/config/data/{}", name))
            .or_else(|_| {
                File::open(format!("/pkgfs/packages/config-data/0/data/setui_service/{}", name))
            })
            .context("Opening package data file")?,
    )?))
}
/// Creates a file-based sound from a resource file.
Creates a file-based sound from a resource file.
Creates a file - based sound from a resource file .
fn resource_file_channel(name: &str) -> Result<zx::Channel, Error> {
    // We try two paths here, because normal components see their config package data resources in
    // /pkg/data and shell tools see them in /pkgfs/packages/config-data/0/data/<pkg>.
    Ok(zx::Channel::from(fdio::transfer_fd(
        File::open(format!("/config/data/{}", name))
            .or_else(|_| {
                File::open(format!("/pkgfs/packages/config-data/0/data/setui_service/{}", name))
            })
            .context("Opening package data file")?,
    )?))
}
fn resource_file_channel ( name : & str ) -> Result < zx :: Channel , Error > { // We try two paths here, because normal components see their config package data resources in // /pkg/data and shell tools see them in /pkgfs/packages/config-data/0/data/<pkg>. Ok ( zx :: Channel :: from ( fdio :: transfer_fd ( File :: open ( format ! ( " " name ) ) . or_else ( | _ | { File :: open ( format ! ( " " name ) ) } ) . context ( " " ) ? , ) ? ) ) }
Creates a file-based sound from a resource file.
Creates a file - based sound from a resource file .
name
&str