[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
can't deal this kind of files, '-filename'
From: |
Lee Huan Chul |
Subject: |
can't deal this kind of files, '-filename' |
Date: |
Fri, 19 Dec 2003 01:27:04 +0900 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; ko-KR; rv:1.2.1) Gecko/20030225 |
for example
#include <stdio.h>
int main(int argc, char **argv)
{
if (!creat("-file", 0755)) {
printf("creat error\n");
exit(1);
}
}
make file of which name is "-file" and do "ls *file"
then error occures like this
ls: invalid option -- e
Try `ls --help' for more information.
this is because coreutils uses raw argv(in main) as getopt's argument(in
decode_switches, ls.c:1371).
of course if using "ls $PWD/*file", then it works well.
i tried with coreutils-4.5.3-19 and coreutil-5.0.
sorry for poor English.
thanks for reading.
- can't deal this kind of files, '-filename',
Lee Huan Chul <=