file_untargz Subroutine

public subroutine file_untargz(tarball)

Arguments

Type IntentOptional Attributes Name
character(len=*) :: tarball

Calls

proc~~file_untargz~~CallsGraph proc~file_untargz file_untargz interface~reg reg proc~file_untargz->interface~reg interface~str str proc~file_untargz->interface~str

Source Code

  subroutine file_untargz(tarball)
    character(len=*)           :: tarball
    integer                    :: control
    logical                    :: iexist,iopen
    integer                    :: unit
    character(len=4),parameter :: type='.tgz'
    character(len=100)         :: cmsg
    inquire(file=reg(tarball)//type,exist=iexist)
    if(.not.iexist)then
       write(*,"(A)")"Tarball "//str(tarball)//type//" not present: skip"
       return           !nothing to be done:
    endif
    write(*,"(A)")"deflate "//reg(tarball)//type
    call execute_command_line("tar -xzf "//str(tarball)//type//" ",CMDSTAT=control,CMDMSG=cmsg)
    if(control>0)then
       write(*,"(A)")"Command tar -xzf failed with error: "//str(cmsg)
    elseif(control<0)then
       write(*,"(A)")"Command tar -xzf not supported"
    else
       call execute_command_line("rm -f "//str(tarball)//type)
    endif

  end subroutine file_untargz