RmDir removes the subdirectory with the path specified by S or P. If the path does not exist, is non-empty, or is the currently logged directory, an I/O error occurs. //rmdir 删除指定的子目录,如果指定的目录不存在,不为空,或是当前的目录,会有一个I/O错误发生;
正如各位所说的这个目录中有文件。但是我用DeleteFile(strSrcDir+sr.Name);为什么无法把文件删除。删除文件那句如下: if sr.Attr<>faDirectory then begin DeleteFile(strSrcDir+sr.Name); end;
DeleteFile(strSrcDir+'\'+sr.Name);试试看;
Another reproducible compiler crash (access violation)
如果是其它的文件,要看文件是否已经被程序打开,先关闭,后释放,再删除!
最后,注意 DLL 工程是否将 ShareMem 做为第一个被引用文件!
//rmdir 删除指定的子目录,如果指定的目录不存在,不为空,或是当前的目录,会有一个I/O错误发生;
if sr.Attr<>faDirectory then
begin
DeleteFile(strSrcDir+sr.Name);
end;