Skip to content

Error file_not_found in Windows when missing read permission #14528

Closed

Description

@bminer

Describe the bug

When using the open command in Nu to open a file, I receive a file_not_found error when I have no permissions to read the file.

A better error message would be nice (i.e. "no permission to access file") instead of "file not found".

How to reproduce

  1. Create a file in Windows
  2. Remove read permissions for the logged in user
  3. Try to open the file with Nu
> echo ($env.systemroot ++ '\System32\LogFiles\Firewall\pfirewall.log') | open $in
Error: nu::shell::file_not_found

  × File not found
   ╭─[entry #19:1:78]
 1 │ echo ($env.systemroot ++ '\System32\LogFiles\Firewall\pfirewall.log') | open $in
   ·                                                                              ─┬─
   ·                                                                               ╰── file not found
   ╰────
  help: C:\WINDOWS\System32\LogFiles\Firewall\pfirewall.log does not exist

Expected behavior

Return a better error message like "no permissions to access file" or something similar.

Configuration

key value
version 0.100.0
major 0
minor 100
patch 0
branch
commit_hash 30f98f7
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.80.1 (3f5fd8dd4 2024-08-06)
rust_channel 1.80.1-x86_64-pc-windows-msvc
cargo_version cargo 1.80.1 (376290515 2024-07-16)
build_time 2024-11-13 03:41:33 +00:00
build_rust_channel release
allocator mimalloc
features default, sqlite, trash
installed_plugins query 0.100.0

Thank you contributors for your hard work on this project!!

Activity

  1. added
    status:needs-triage
    on Dec 6, 2024
  2. added
    A:error-unhelpful
    A:file-system
    platform:windows
    on Dec 6, 2024
  3. added this to the v0.102.0 milestone on Jan 7, 2025
  4. bminer commented on Jan 14, 2025

    @bminer
    Author

    Thank you! nushell is amazing!

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

    A:error-unhelpfulA:file-systemplatform:windowsstatus:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions