' *** FILECOPY.LST *** 2nd GFA-Manual, page 11-21 > PROCEDURE file_copy(move!,source$,target$) ' ' *** Copy file source$ to target$ (names with complete path!) ' *** If target$ consists of path only ("A:TEST\"), file from source$ is added ' *** If move!=TRUE source$ will be deleted ' *** Procedure uses channel #90 and #91 ' *** High speed is accomplished by loading 31 clusters at a time ' LOCAL m$,k,name$,p,file$,block% IF source$=target$ ! protect user from disaster m$=" *** Error ***|File-copy aborted |because names of source |" m$=m$+"and target are identical" ALERT 3,m$,1," OK ",k ELSE IF RIGHT$(target$)="\" ! only path in target$ target$=target$+RIGHT$(source$,LEN(source$)-RINSTR(source$,"\")) ENDIF IF EXIST(target$) name$=UPPER$(RIGHT$(target$,LEN(target$)-RINSTR(target$,"\"))) m$="The file "+name$+"|already exists: delete file |or rename as *.BAK?" ALERT 3,m$,0,"Delete|*.BAK",k IF k=1 KILL target$ ELSE p=INSTR(target$,".") IF p>0 file$=LEFT$(target$,p)+"BAK" ELSE file$=target$+".BAK" ENDIF IF EXIST(file$) KILL file$ ENDIF RENAME target$ AS file$ ENDIF ENDIF OPEN "I",#90,source$ OPEN "O",#91,target$ block%=LOF(#90) WHILE block%>31744 PRINT #91,INPUT$(31744,#90); SUB block%,31744 WEND PRINT #91,INPUT$(block%,#90); CLOSE #90 CLOSE #91 IF move! KILL source$ ! delete file source$ (file-move) ENDIF ENDIF RETURN ' ********* '