加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

delphi – 检查目录是否可读

发布时间:2020-12-15 04:19:03 所属栏目:大数据 来源:网络整理
导读:我们如何检查目录是否是readOnly或Not? 解决方法 您可以使用 FileGetAttr 函数并检查是否设置了faReadOnly标志. 试试这段代码 function DirIsReadOnly(Path:string):Boolean;var attrs : Integer;begin attrs := FileGetAttr(Path); Result := (attrs and f
我们如何检查目录是否是readOnly或Not?

解决方法

您可以使用 FileGetAttr函数并检查是否设置了faReadOnly标志.

试试这段代码

function DirIsReadOnly(Path:string):Boolean;
var
 attrs    : Integer;
begin
 attrs  := FileGetAttr(Path);
 Result := (attrs  and faReadOnly) > 0;
end;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读