You are checking -f $file in the current directory, but $file is a file inside the directory you are reading. So there is no such file, and the -f test returns false, which you interpret as a directory.
In reply to Re: read_dir issue
by moritz
in thread read_dir issue
by snowlight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |