file_targz Subroutine

public subroutine file_targz(tarball, pattern, size)

Arguments

Type IntentOptional Attributes Name
character(len=*) :: tarball
character(len=*) :: pattern
integer, optional :: size

Calls

proc~~file_targz~~CallsGraph proc~file_targz file_targz interface~str str proc~file_targz->interface~str

Source Code

  subroutine file_targz(tarball,pattern,size)
    character(len=*)           :: tarball
    character(len=*)           :: pattern
    integer,optional           :: size
    character(len=4),parameter :: type='.tgz'
    integer                    :: control,fsize
    character(len=100)         :: cmsg
    fsize=store_size;if(present(size))fsize=size
    write(*,"(A)") "Store "//str(pattern)//" in "//str(tarball)//type
    call execute_command_line("tar -czf "//str(tarball)//type//" "//str(pattern),CMDSTAT=control,CMDMSG=cmsg)
    if(control>0)then
       write(*,"(A)")"Command tar -czf failed with error: "//str(cmsg)
    elseif(control<0)then
       write(*,"(A)")"Command tar -czf not supported"
    else
       call execute_command_line("rm -f "//str(pattern))
    endif
  end subroutine file_targz