I have one minor issue. I’m trying to check whether a directory is
given some path to the directory.
My code does the following:
if(File.directory?(dirpath)) # dirpath = public/images/1
The problem is, while testing this, if I put a file in the directory and
the above code, it still ends up deleting the entire directory which
make sense since File.zero? should not return true. I even tried using
File.size?(dirpath) but that doesn’t work either.
Any help would be appreciated.