system_rmdir(3f) - [M_system:FILE_SYSTEM] call rmdir(3c) to remove empty directories (LICENSE:PD)
Synopsis
Description
Examples
Author
License
function system_rmdir(dirname) result(err)
character(*),intent(in) :: dirname integer(c_int) :: err
DIRECTORY The name of a directory to remove if it is empty err zero (0) if no error occurred
Sample program:
program demo_system_rmdir use M_system, only : system_perror use M_system, only : system_rmdir, system_mkdir use M_system, only : RWX_U implicit none integer :: ierr write(*,*)’BEFORE TRY TO CREATE _scratch/’ call execute_command_line(’ls -ld _scratch’)Expected output:write(*,*)’TRY TO CREATE _scratch/’ ierr=system_mkdir(’_scratch’,RWX_U) write(*,*)’IERR=’,ierr call execute_command_line(’ls -ld _scratch’)
write(*,*)’TRY TO REMOVE _scratch/’ ierr=system_rmdir(’_scratch’) write(*,*)’IERR=’,ierr call execute_command_line(’ls -ld _scratch’)
write(*,*)’TRY TO REMOVE _scratch when it should be gone/’ ierr=system_rmdir(’_scratch’) call system_perror(’*test of system_rmdir*’) write(*,*)’IERR=’,ierr call execute_command_line(’ls -ld _scratch’)
end program demo_system_rmdir
John S. Urban
Public Domain
Nemo Release 3.1 | system_rmdir (3) | February 23, 2025 |