Re: Version 2.1.70 ms-dos fs strange.

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Sun, 7 Dec 1997 10:06:29 +0100 (MET)


Richard B. Johnson wrote:
>
> On Sat, 6 Dec 1997, Bill Hawes wrote:
>
> > Richard B. Johnson wrote:
> > > # ls /tmp/*.bak
> > > ls: /tmp/*.bak: No such file or directory
> > > # ls /dos/drive_C/*.bak
> > > ls: /dos/drive_C/*.bak: Invalid argument
> > > # exit
> > > exit
> > >
> > > Script done on Fri Dec 5 19:34:44 1997
> > >
> > > Synopsis:
> > > `ls` for a nonexistant file under ext2 results in ENOENT.
> > > `ls` for a nonexistant file under msdos results in EINVAL.
> > > NotGood(tm)
> >
> > Apparently what happens is that when no files match the pattern *.bak,
> > ls tries to stat the name '*.bak', which is an invalid filename under
> > DOS.
> >
> > Doing an ls on 'fooble' or other nonexistent names returns "no such
> > file".
> >
> > Regards,
> > Bill
> >
> But filename.bak or FILENAME.BAK or *.BAK, etc, are not invalid names
> under MS-DOS.
>
> The relatively new behavior makes scripts that contain :
> rm -f *.bak
> ... on a MS-DOS file-system fail because rm ignores ENOENT (only) when
> using the (f)orce option. I can modify rm, but this is not the correct
> fix.

So, go ahead and fix your shell.

*.bak doesn't match anything, it should return "nothing". My shell
(tcsh) says "*.bak: no match" in that case. When I do "rm *.o *.bak"
and *.o matches something and *.bak doesn't, then I don't get the
message, *.bak evaluates to an empty string, and all goes well.

Roger.

-- 
** R.E.Wolff@BitWizard.nl ** +31-15-2137555 ** http://www.BitWizard.nl/ **
Florida -- A 39 year old construction worker woke up this morning when a
109-car freight train drove over him. According to the police the man was 
drunk. The man himself claims he slipped while walking the dog. 080897