Skip to content

Permission denied to read file #1519

@barenko

Description

@barenko

What version of bat are you using?
bat 0.17.1

Describe the bug you encountered:
I Have a file with read permission:
.rw-r--r-- 7,0k myuser 14 Jan 23:16 .zshrc

I tried to read normally (with the file owner)
batcat .zshrc
[bat error]: '.zshrc': Permission denied (os error 13)

I retried using sudo:
sudo batcat /home/myuser/.zshrc
[bat error]: '/home/myuser/.zshrc': Permission denied (os error 13)

...

What did you expect to happen instead?
show the file contents
...

How did you install bat?
using the snap package


Environment

system

$ uname -srm
Linux 5.4.0-26-generic x86_64

$ lsb_release -a
No LSB modules are available.
Distributor ID: Linuxmint
Description: Linux Mint 20
Release: 20
Codename: ulyana

bat

$ batcat --version
bat 0.17.1

$ env
PAGER=less

bat_config

bat_wrapper

No wrapper script for 'bat'.

No wrapper script for 'batcat'.

bat_wrapper_function

No wrapper function for 'bat'.

No wrapper function for 'cat'.

No wrapper function for 'batcat'.

tool

$ less --version
less 551 (GNU regular expressions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions