判断文件夹是否存在的函数是什么??

szyrainbow 2003-12-25 04:48:38
判断文件夹是否存在的函数是什么??比方说我想判断当前目录下的 s 文件夹是否存在。。
函数是什么??
...全文
36 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
dongliu 2003-12-25
  • 打赏
  • 举报
回复
同意
chinajia 2003-12-25
  • 打赏
  • 举报
回复
procedure TForm1.Button1Click(Sender: TObject);
begin
if not DirectoryExists('c:\temp') then
if not CreateDir('C:\temp') then
raise Exception.Create('Cannot create c:\temp');
end;
reedseutozte 2003-12-25
  • 打赏
  • 举报
回复
Determines whether a specified directory exists.

Unit

FileCtrl

Category

file management routines

function DirectoryExists(Name: string): Boolean;

Description

Call DirectoryExists to determine whether the directory specified by the Name parameter exists. If the directory exists, the function returns True. If the directory does not exist, the function returns False.

If a full path name is entered, DirectoryExists searches for the directory along the designated path. Otherwise, the Name parameter is interpreted as a relative path name from the current directory.

5,387

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧