I am writing a program that searches for directories on a computer. On my own computer, I have a disk that was previously loaded in Windows Vista.
(However, there are disks that don’t appear even when “show hidden folders.” I see folders working with cmd, but this does not solve my problem.)
I don't care about folders, but I really care about comparing strings with their names. However, string.equals () and string.compareTo () do not work with these phantom folders when I get their name using File directory.getName ().
I printed the names, checked for spaces, used cropping, etc., but the hidden folder with the name "Download" still does not match the line with the same value.
The TL; DR: phantom lists return an immutable / comparable string to the directory.getName () file.
Besides solving the problem, I’m just curious to know what’s going on.
source
share