Manual Reference Pages  - system_rmdir (3m_system)

NAME

system_rmdir(3f) - [M_system:FILE_SYSTEM] call rmdir(3c) to remove empty directories (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Examples
Author
License

SYNOPSIS

function system_rmdir(dirname) result(err)

     character(*),intent(in) :: dirname
     integer(c_int) :: err

DESCRIPTION

Remove a directory

OPTIONS

DIRECTORY
  The name of a directory to remove if it is empty
err zero (0) if no error occurred

EXAMPLES

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’)

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

Expected output:

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 system_rmdir (3m_system) March 07, 2025
Generated by manServer 1.08 from bdd3ddca-b0a0-489e-a69c-df233eab932a using man macros.