How to find out if a dir exists?

I know you can use FileExists to find out if a file exists, but is there a similar way to find out if a directory exists? I can't seem to find it.
ripcordAsked:
Who is Participating?
 
MadshiConnect With a Mentor Commented:
ripcord,

function fio_DirExists(dir: string) : boolean;  
// no backslash at the end of "dir", please...
var i1 : integer;
begin
  i1:=GetFileAttributes(pchar(dir));
  result:=(i1<>-1) and (FILE_ATTRIBUTE_DIRECTORY and i1<>0);
end;

Regards, Madshi.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.