Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

delete a directory

woshiwuxin
초보자
1,557 조회수
Hello!
I'm using the intel fortran compiler. I realize that the subroutine 'PXFMKDIR' can create a directory. Could anyone tell me which subroutine (or function) can delete a directory containing some files?
I just want something different from the 'SYSTEM'-like functions.
Thank you in advance!
0 포인트
2 응답
TimP
명예로운 기여자 III
1,556 조회수
It looks like you have the choice between deleting the files first, then deleting the directory by Posix or legacy QQ function calls, or shell commands like SYSTEM("rm -r ....") (soon to be replaced by execute_command_line)
0 포인트
jimdempseyatthecove
명예로운 기여자 III
1,556 조회수
To add to TimP's comment regarding SYSTEM, or soon to be replaced by execute_command_line, I suggest that the text that you use to provide the command comes from a resource file or "config" file as opposed to being hard coded into the application. The directory delete command name may depend upon the users shell choice (isdirectory delete aDEL, RMDIR, UNLINK, ...?). And as Tim eludes, the directory removal may or may not require pre-deletion of files (assuming none are open) and/or removal from focus by other processes (no other process having current directory as that which you wish to delete). If you want to bullet-proof and future-proof the directory delete operation, these issues, and maybe more, should be addressed.

Jim Dempsey
0 포인트
응답