Open balroggg opened 2 years ago
Bat
time bat file.ova
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: file.ova <BINARY>
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
real 2m52,606s
user 0m12,487s
sys 0m23,694s
Inspect from content_inspector
inspect file.ova`
file.ova: binary
real 0m0,213s
user 0m0,083s
sys 0m0,022s
file --mime
time file --mime file.ova
file.ova: application/x-tar; charset=binary
real 0m0,042s
user 0m0,000s
sys 0m0,007s
hexyl --border none -n 32 file.ova
00000000 73 69 65 73 2d 6d 63 2e 6f 76 66 00 00 00 00 00 sies-mc. ovf00000
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000000 00000000
00000020
Thank you for the detailed bug report. The reason is probably that bat
(in order to apply the content_inspector
heuristic of detecting binary files) reads the full first line instead of just the first N bytes (like inspect
). If there is no \n
character in the binary file, that can take a long time.
In this sense, this is related to #304
Marking as "help wanted" because there is a PR that just needs some debugging: https://github.com/sharkdp/bat/pull/2369
What steps will reproduce the bug?
What happens?
Take too long to output something
What did you expect to happen instead?
Print that it is a binary file
How did you install
bat
?pacman, Archlinux
bat version and environment
bat --diagnostic
Software version
bat 0.21.0 (405e5f74)
Operating system
Linux 5.18.16-arch1-1
Command-line
Environment variables
Config file
Custom assets metadata
Could not read contents of '/home/balrog/.cache/bat/metadata.yaml': No such file or directory (os error 2).
Custom assets
'/home/balrog/.cache/bat' not found
Compile time information
Less version