dezlov/PascalTZ

Fix ReloadDatebasePath on Unix OS

Al-Muhandis opened this issue · 2 comments

Please check request #5

On Unix, passing a directory name will result in True with FileExists function (because directory is file too in Unix). So it's valid to check if is really file not directory.
Perhaps it's more beautiful to just put a check on the directory at the beginning, but I'm not sure if this matches the logic of the code. That is it is possible and so, it is possible

if DirectoryExists(FDatabasePath) then
  ParseDatabaseFromDirectory(FDatabasePath)
else if FileExists(FDatabasePath) then
  ParseDatabaseFromFile(FDatabasePath)

P.S. Thanks for awesome and useful lib!

Thank you for reporting this issue.

It should be fixed in f7f0491, please check.

Thank you