"ls" finds file1 but "ls file1" does not

Charles D. Russell worwor@bellsouth.net
Mon May 9 19:13:00 GMT 2005


"ls" finds file1 but "ls file1" does not.  How can this happen?

The following example occurred just after I had renamed some *.htm files
to *.html using
an ash shell script.  No such problem occurred, however, when I used DOS
"rename" to make
the same change.  (Windows XP Pro SP 2)

Does Windows have some kind of special handling for the extension .htm?

EXAMPLE:

cdr@dell03 /cygdrive/c/Documents and Settings/cdr/My
Documents/books_open/c/stdcbook_bad/STD_c
$ ls
_index.htm*    finder.dat*     lib_over.htm*   setjmp.htm*   time.htm*
assert.htm*    float.htm*      lib_prin.htm*   signal.htm*   types.htm*
charset.htm*   function.htm*   lib_scan.htm*   stdarg.htm*   wchar.htm*
crit_pb.htm*   gif/            limits.htm*     stddef.htm*   wctype.htm*
ctype.htm*     index.htm*      locale.htm*     stdio.htm*   ./
declare.htm*   intro.htm*      math.htm*       stdlib.htm*  ../
errno.htm*     iso646.htm*     portable.htm*   string.htm*
express.htm*   lib_file.htm*   preproc.htm*    syntax.htm*

cdr@dell03 /cygdrive/c/Documents and Settings/cdr/My

Documents/books_open/c/stdcbook_bad/STD_c
$ ls assert.htm
ls: assert.htm: No such file or directory  <--  **** THIS IS THE PROBLEM
****

        a bit of exploration follows:

cdr@dell03 /cygdrive/c/Documents and Settings/cdr/My
Documents/books_open/c/stdcbook_bad/STD_c
$ ls as*
ls: as*: No such file or directory

cdr@dell03 /cygdrive/c/Documents and Settings/cdr/My

Documents/books_open/c/stdcbook_bad/STD_c
$ ls *.htm
_index.htm*    express.htm*    lib_over.htm*   preproc.htm*   string.htm*
assert.htm*    float.htm*      lib_prin.htm*   setjmp.htm*    syntax.htm*
charset.htm*   function.htm*   lib_scan.htm*   signal.htm*    time.htm*
crit_pb.htm*   index.htm*      limits.htm*     stdarg.htm*    types.htm*
ctype.htm*     intro.htm*      locale.htm*     stddef.htm*    wchar.htm*
declare.htm*   iso646.htm*     math.htm*       stdio.htm*     wctype.htm*
errno.htm*     lib_file.htm*   portable.htm*   stdlib.htm*

cdr@dell03 /cygdrive/c/Documents and Settings/cdr/My
Documents/books_open/c/stdcbook_bad/STD_c
$ ls AS*
ls: AS*: No such file or directory


cdr@dell03 /cygdrive/c/Documents and Settings/cdr/My
Documents/books_open/c/stdcbook_bad/STD_C
$ ls -l
total 722
-rwx------+   1 cdr      None        58614 Oct 12  1995  _index.htm*
-rwx------+   1 cdr      None         2177 Oct 12  1995  assert.htm*
-rwx------+   1 cdr      None        17888 Oct 12  1995  charset.htm*
-rwx------+   1 cdr      None         3661 Oct 12  1995  crit_pb.htm*
-rwx------+   1 cdr      None         9185 Oct 12  1995  ctype.htm*
-rwx------+   1 cdr      None        42189 Oct 12  1995  declare.htm*
-rwx------+   1 cdr      None         2584 Oct 12  1995  errno.htm*
-rwx------+   1 cdr      None        84781 Oct 12  1995  express.htm*
-rwx------+   1 cdr      None         3440 Nov 20  1995  finder.dat*

The only difference here from a correctly working directory is that the
correctly working
directory does not have execute permissions




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list