# File

The `file` is used to query file metadata information.

```rust
/// Asynchronously retrieves the `FileInfo` associated with a given hash, and optionally
/// verifies it against a specified block hash.
///
/// # Parameters
/// - `hash`: A string slice that holds the hash identifier for the file.
/// - `block_hash`: An optional `H256` hash representing the block hash to verify the file against.
///
/// # Returns
/// A `Result` which is:
/// - `Ok(Some(FileInfo))` if the file is found and successfully retrieved.
/// - `Ok(None)` if the file is not found.
/// - `Err(Box<dyn std::error::Error>)` if there is an error during retrieval.
///
pub async fn file(
    hash: &str,
    block_hash: Option<H256>,
) -> Result<Option<FileInfo>, Box<dyn std::error::Error>>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/file_bank/file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
