pub(crate) async fn is_binary(file: &mut File) -> Result<(bool, String)> {
        // Read sample data
        let mut sample = vec![0; 8192];
        let bytes_read = file.read(&mut sample).await?;
        sample.truncate(bytes_read);

        // Handle empty files
        if bytes_read == 0 {
            return Ok((true, "Empty file".into()));
        }

        // Get file type info
        let is_text = match infer::get(&sample) {
            Some(info) => matches!(
                info.matcher_type(),
                infer::MatcherType::Text | infer::MatcherType::Doc
            ),
            None => true, // Assume text if type can't be determined
        };

        let description = infer::get(&sample)
            .map(|info| info.mime_type().to_string())
            .unwrap_or_else(|| "Text file (no specific format detected)".into());

        Ok((is_text, description))
    }
Checks if a file is binary by examining its content.
This version takes an already opened file handle, allowing for reuse
of the same file handle across multiple operations.
This is a crate-private implementation detail.
crates/forge_fs/src/is_binary.rs