' ramcopy ' CLS PRINT PRINT " Ramcopy v1.0 By Stefan Posthuma" PRINT " Created by Digital Insanity" PRINT IF FRE(0)<40000 ! need about 40000 bytes PRINT " Sorry, not enough free memory...." PRINT PRINT " Press a key...." VOID INP(2) CLS SYSTEM ENDIF einde!=FALSE @bestaat ! check for ramdisk.inf buf$=SPACE$(32000) ! 32000 bytes buffer for copy VOID FRE(0) WHILE einde!=FALSE ! while not EOF @lezen ! read next filename from ramdisk.inf IF bestaat!=TRUE ! file exists? @copy ! yes, copy it ENDIF WEND CLOSE #1 PRINT PRINT " Press a key...." VOID INP(2) CLR buf$ CLEAR CLS SYSTEM ! back to the desktop ' PROCEDURE bestaat n$="a:\auto\ramdisk.inf" IF NOT EXIST(n$) n$="a:\ramdisk.inf" IF NOT EXIST(n$) einde!=TRUE PRINT " ramdisk.inf does not exist. No copy..." ENDIF ENDIF IF einde!=FALSE PRINT " Found ramdisk.inf....copy files (Y/N)" PRINT REPEAT k%=INP(2) UNTIL k%=121 OR k%=110 IF k%=110 ! user pressed N, exit program CLS SYSTEM ENDIF OPEN "i",#1,n$ ! open ramdisk.inf ENDIF RETURN ' PROCEDURE lezen bestaat!=TRUE IF EOF(#1) ! End-Of-File einde!=TRUE bestaat!=FALSE ELSE LINE INPUT #1,a$ ! get filename IF LEFT$(a$)="@" ! create folder a$=RIGHT$(a$,LEN(a$)-1) PRINT " Creating folder ";a$;"..."; CHDRIVE (4) @dir_exist(a$,*e%) ! check if folder already exists IF e%=-33 ! no MKDIR a$ ! create it ELSE PRINT "it already exists!" bestaat!=FALSE ENDIF CHDRIVE (1) IF bestaat!=TRUE PRINT "done!" bestaat!=FALSE ENDIF ELSE a$="A:\"+a$ ! add pathname PRINT " Checking ";a$; IF NOT EXIST(a$) ! check if file exists bestaat!=FALSE PRINT AT(50,CRSLIN);"it does not exist!" ENDIF ENDIF ENDIF RETURN ' PROCEDURE copy OPEN "i",#2,a$ l%=LOF(#2) ! determine length of the file to be copied IF l%>=DFREE(4) ! not enough memory in ramdisk? PRINT AT(50,CRSLIN);"no way, file too large!" ELSE PRINT AT(50,CRSLIN);"copying...."; OPEN "o",#3,"d:"+RIGHT$(a$,LEN(a$)-3) WHILE l%>32000 BGET #2,VARPTR(buf$),32000 ! read 32000 bytes from original file BPUT #3,VARPTR(buf$),32000 ! write them to ramdisk SUB l%,32000 WEND BGET #2,VARPTR(buf$),l% ! read remainder BPUT #3,VARPTR(buf$),l% ! write it CLOSE #3 PRINT "done!" ENDIF CLOSE #2 RETURN ' PROCEDURE dir_exist(name$,e.%) LOCAL a$ a$=SPACE$(44) VOID GEMDOS(&H1A,L:VARPTR(a$)) ! create disk transfer buffer *e.%=GEMDOS(&H4E,L:VARPTR(name$),&H10) ! search for filename RETURN