Open GoogleCodeExporter opened 9 years ago
sorry , I meant under FAT/NTFS is does not return TEST (not FRED)
Original comment by Steve6375
on 30 May 2013 at 6:56
[deleted comment]
hmm, it seems that FAT32/FAT16/ext2 differ from exFAT and NTFS when using the
ls command...
on an NTFS or exFAT volume an empty directory returns 'file not found' for ls
/EMPTY/ , but on a FAT16/FAT32/ext2 volumes it does not.
so on NTFS and exFAT, if /AUTO folder is empty
ls /AUTO/ || echo EMPTY FOLDER
works
but on an ext2 or FAT32 volume, it does not
Expected behaviour is that the exFAT and NTFS behaviour is correct. We can test
for an empty directory using ls, but on FAT/ext2 volumes we cannot test for an
empty directory.
or can you suggest a different way to detect an empty directory?
best way I have found is
ls (bd)/_ISO/AUTO/ > (md)0x3300+1 && checkrange 0 read 0x660000 > nul && echo
EMPTY FOLDER!
Original comment by Steve6375
on 21 Jun 2013 at 12:15
Typical example where I want to test for an empty folder with simple command
Works on NTFS drive but not on FAT drive
iftitle [ls (bd)/_ISO/ANTIVIRUS/ > nul] ^Ctrl+A ANTIVIRUS Menu [Ctrl+A]\n
AntiVirus utilities
etc
etc
Original comment by Steve6375
on 6 Jul 2013 at 11:29
another anomaly...
if we have an empty folder on an NTFS partition (hd0,6) and an empty folder on
a FAT32 partition (hd0,5) (logical volumes but same issue on Primary partitions
too):
cat --length=0 (hd0,6)/empty
--> Filesize is 0x0
cat --length=0 (hd0,5)/empty
--> Error 2: Bad file or directory type
also
Two directories called EMPTY (uppercase), one on FAT32, one on NTFS. Also have
a file called FRED.txt (mixed case)
ls (hd0,6)/
--> $AttrDef $BadClus (etc.....) EMPTY FRED.txt
ls (hd0,5)/
empty FRED.txt
Notice how the folder EMPTY is listed as 'empty' on a FAT volume (lower case).
Original comment by Steve6375
on 9 Jul 2013 at 5:52
Original issue reported on code.google.com by
Steve6375
on 30 May 2013 at 6:03