I am writing a multi-platform application using Delphi 10.2 Tokyo Firemonkey. One of the things I need to check is if Dropbox exists on the computer. For this I need to check for the presence of an info.json file and then process that json file to get the path of the Dropbox folder.
I wrote this function to check for the presence of Dropbox:
class function TUtilityMac.DropboxExists: Boolean;
var
infojsonpath: String;
begin
Result:=false;
infojsonpath:='~/.dropbox/info.json';
if not FileExists (infojsonpath, True) then
exit;
Result:=true;
end;
But when I run this on a Mac (that has Dropbox installed), the FileExists
function returns false
(regardless of the second parameter being True
or False
). If I open a terminal window and do a cd ~/.dropbox
and then a dir
, I do see the info.json file there.
Any thoughts around what I am missing? Would appreciate any pointers regarding this...