delphi 判断目录是否可写
2024-08-27 19:16:23
FUNCTION WritableDir(CONST Dir : STRING) : BOOLEAN;
VAR
FIL : FILE;
N : STRING;
I : Cardinal; BEGIN
REPEAT
N:=IncludeTrailingPathDelimiter(Dir);
FOR I:= TO -LENGTH(N) DO N:=N+CHAR(RANDOM()+)
UNTIL NOT FileExists(N);
Result:=TRUE;
TRY
AssignFile(FIL,N);
REWRITE(FIL,)
EXCEPT
Result:=FALSE
END;
IF Result THEN BEGIN
CloseFile(FIL);
ERASE(FIL)
END
END;
http://blog.csdn.net/genispan/article/details/10004487
最新文章
- ASP.NET MVC 5 Web编程3 -- Controller的应用及扩展
- Position和anchorPoint
- 对angular实现延迟加载template和controller
- android adb shell
- CSS3设置字体
- Java NIO 与 基于reactor设计模式的事件处理模型
- leetcode:Rotate Array
- android开发之路08(ListView&;Adapter)
- BZOJ3394: [Usaco2009 Jan]Best Spot 最佳牧场
- JavaScript各种继承方式和优缺点
- RunLoop总结:RunLoop 与GCD 、Autorelease Pool之间的关系
- Groovy 设计模式 -- 适配器模式
- Maya cmds pymel scriptJob() 和 undoInfo() 在回调中撤销(undo)
- Oracle表空间的创建与删除
- Android 學習之旅!(1)
- XXXcannot be resolved to a type
- qt 软件打包
- Expo大作战(二十五)--expo sdk api之Admob
- css display table使用小例子实验
- November 23rd 2016 Week 48th Wednesday
热门文章
- Distribution download cancelled. Using distribution from 'https://services.gradle.org/distributions/
- style.height、offsetHeight、clientHeight、scrollHeight的差别
- Ubuntu安装编译OpenCV一键脚本(带ffmpeg)
- 最好用的中文速查表(Bash,Gdb,VIM,Nano)
- 【BZOJ 1016】 [JSOI2008]最小生成树计数(matrix-tree定理做法)
- Java 中StringBuffer与StringBuilder区别(转)及String类的一些基本操作代码
- QQ登录, 腾讯开放平台和QQ互联的坑
- Jdbc连接MySQL 8时报错“MySQLNonTransientConnectionException: Public Key Retrieval is not allowed”
- 一个封装了的选项卡效果js
- Android官方教程翻译(6)——添加ActionBar