rust-lang / rust-lang/rust

Tracking Issue for `file_buffered`

Open
#130,804 5 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-filesystem C-tracking-issue T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Feature gate: #![feature(file_buffered)]

This is a tracking issue for File constructors that return files wrapped with a buffer.

In addition to the light convenience, these are intended to raise visibility that buffering is something you should consider when opening a file, since unbuffered I/O is a common performance footgun to Rust newcomers.

Public API
// std::fs

impl File {
    pub fn open_buffered<P: AsRef<Path>>(path: P) -> io::Result<io::BufReader<File>>;
    pub fn create_buffered<P: AsRef<Path>>(path: P) -> io::Result<io::BufWriter<File>>;
}
Steps / History
  • API Change Proposal (ACP): rust-lang/libs-team#446
  • Implementation: #130803
  • Final comment period (FCP)^1
  • Stabilization PR
Unresolved Questions
  • None yet.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the completed API Change Proposal rust-lang/libs-team#446 and implementation #130803, then follow the stabilization process linked in the issue. Confirm the proposed File constructors and their documentation are ready for the final comment period and stabilization PR.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.