	subroutine choose_copy_path(from_dir,to_dir,filename)
c	This subroutine copies the file "filename" from directory "from_dir" to
c	directory "to_dir" and for doing this it calls subroutine "runner".
	character from_dir*(*),to_dir*(*),from_file*160,to_file*160
	character temp*256,filename*(*)
	length1=index(from_dir,'  ')-1
	if(length1.eq.-1)length1=len(from_dir)
	from_file=from_dir(1:length1)//'\'//filename
	length2=index(to_dir,'  ')-1
	if(length2.eq.-1)length2=len(to_dir)
	to_file=to_dir(1:length2)//'\'//filename
	temp= 'copy '//from_file(1:index(from_file,'  ')-1)//' '//to_file
     *(1:index(to_file,'  ')-1)
	call runner(temp(1:index(temp,'  ')-1),0,1)
	end


	subroutine runner(argument,ireport,iolog)
c	This subroutine puts the argument in the parenthesis in the system shell
c	command. If the argument is something like "copy file1 file2" it will do
c	exactly a task of copying. This subroutine is called by many other ones.
c	It reports the success of this task to unit "iolog" (will not if ireport=0).
	USE PORTLIB
	character argument*(*)
	integer(4) i
	i=system(argument)
	if(ireport.eq.0)return
	if(i.eq.-1)then
	write(iolog,*)argument,' was not successful.'
	else
	write(iolog,*)argument,' was successful.'
	endif
	end


	subroutine mkdir(dirname,ireport,iolog)
c	Function currdir finds the current working directory and assigns the name
c	to currdir, then it reports the success of this task to unit "iolog" (will 
c	not if ireport=0).
	USE MSFLIB
	character dirname*(*)
	logical(4) imakedirqq
      imakedirqq=makedirqq(dirname)
	if(ireport.eq.0)return
	if (imakedirqq.gt.0) then
	write (iolog,1) dirname
1	format(' The directory "',a,'" was generated successfully.')
	else
	write (iolog,2) dirname
2	format(' The directory "',a,'" was not generated successfully.')
	endif
	return
	end


	function currdir(ireport,iolog)
c	Function currdir finds the current working directory and assigns the name
c	to currdir, then it reports the success of this task to unit "iolog" (will 
c	not if ireport=0).
	USE MSFLIB
	character currdir*(*)
	integer(4) igetdrivedirqq
	currdir=FILE$CURDRIVE
      igetdrivedirqq=getdrivedirqq(currdir)
	if(ireport.eq.0)return
	if (igetdrivedirqq.gt.0) then
	write (iolog,1) currdir(1:index(currdir,' ')-1)
1	format(' The current directory is: "',a,'".')
	else
	write (iolog,2) currdir(1:index(currdir,' ')-1)
2	format(' The cuurent directory lenght too long.')
	endif
	return
	end


	subroutine changedir(dir,ireport,iolog)
c	Subroutine changedir changes the current directory to the directory "dir" 
c	and reports the (un)successful change of directory to unit "iolog" (will
c	not if ireport=0).
	USE MSFLIB
	character dir*(*)
	logical(4) ichangedirqq
	ichangedirqq=changedirqq(dir)
	if(ireport.eq.0)return
	if (ichangedirqq) then
	write (iolog,1) dir
1	format(' The change directory "',a,'" was successful.')
	else
	write (iolog,2) dir
2	format(' The change directory "',a,'" was not successful.')
	endif
	return
	end