Skip to content

Docs for FileStream constructors are confusing about accessing devices #1124

Open

Description

@svick

The API reference for various constructors of FileStream contain these two paragraphs:

  1. The .NET Framework does not support direct access to physical disks through paths that are device names, such as "\.\PHYSICALDRIVE0 ".

  2. Note
    path is not required to be a file stored on disk; it can be any part of a system that supports access through streams. For example, depending on the system, this class can access a physical device.

On first reading, I thought the two paragraphs are contradicting each other: the first says I can't access physical disks, the second says I can.

On second reading, I realized the paragraphs don't contradict each other: I can access physical devices, just not physical disks.

Is this interpretation correct?

In any case, I think this is confusing. Considering that I think device access is not a common requirement, should the two paragraphs just be deleted? If device access is actually possible this way, maybe it should be explained in a separate article?

Activity

  1. mairaw commented on Jul 10, 2017

    @mairaw
    Contributor

    @JeremyKuhne, @ianhays can you guys help with this one?

  2. JeremyKuhne commented on Jul 10, 2017

    @JeremyKuhne
    Member

    This one is a bit complicated. I discuss the various formats in one of my blog posts. We do allow device path syntax in .NET 4.6.2 and above as well as .NET Core.

    I'm fine with deleting the snippets mentioned. It might be good to add an article about .NET path formats on Windows based on the above posts. I'm happy to help review such a change.

  3. transferred this issue fromdotnet/docson Nov 20, 2018
  4. added
    untriaged
    and removed on Nov 20, 2018
  5. added
    Pri3
    on Nov 11, 2020
  6. added this to the Backlog milestone on Aug 9, 2022
  7. ghost removed
    untriaged
    on Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3area-System.IO

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions