View Issue Details

IDProjectCategoryView StatusLast Update
0000601fileGeneralpublic2024-12-26 18:22
ReporterAnton Monroe Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status feedbackResolutionopen 
Product Version5.46 
Summary0000601: file name that starts with "-" / documentation
Description'file' does not handle file names that start with "-". I thought that quoting the filename
should work but it doesn't. So
    file -foo.txt
    file "-foo.txt"
    file *foo.txt
all yield:
    F:\USR\LOCAL\BIN\file.exe: Cannot open `oo.txt' (No such file or directory)
this works:
    file -- -foo.txt
but the "--" switch is not documented in the file(1) man page

TagsNo tags attached.

Activities

christos

2024-12-26 18:22

manager   ~0004137

Like many (most?) other programs file(1) uses getopt(3) where the '--' indicating end-of-options is documented. The only other program explicitly mentioning this in the documentation is rm(1) and this is because newbs have trouble removing files that start with a '-'. For example ls(1) or mv(1) don't mention it. I don't think every program should mention standard command line behavior.

Issue History

Date Modified Username Field Change
2024-12-24 04:33 Anton Monroe New Issue
2024-12-26 18:19 christos Assigned To => christos
2024-12-26 18:19 christos Status new => assigned
2024-12-26 18:22 christos Status assigned => feedback
2024-12-26 18:22 christos Note Added: 0004137