'=========================================================================== ' Subject: SPLIT BIG FILES Date: 10-16-99 (19:56) ' Author: David Drake Code: LB ' Origin: drake@apexmail.com Packet: LIBERTY.ABC '=========================================================================== 'This splits big files into smaller pieces then 'writes a batch file that combines them together 'again. 'By David Drake 'Needs: Make a version for Win3.1 as well. nomainwin [create.main.window] directory$="c:\temp\" size=1440000 dim info$(10,10) UpperLeftX=50 UpperLeftY=50 WindowWidth = 264 WindowHeight = 310 nomainwin textbox #main.filetosplit, 22, 43, 160, 18 textbox #main.directory, 22, 118, 160, 18 textbox #main.sizeotherbox, 135, 184, 72, 18 button #main.selectfile, "Browse", [select.file], UL, 190, 43, 58, 20 button #main.browse, "Browse", [select.directory], UL, 190, 118, 58, 20 button #main.ok, "Split File",[split.file],UL,22,255,88,20 button #main.help, "Help",[help],UL,125,255,50,20 button #main.cancel, "Quit",[end.it],UL,190,255,58,20 radiobutton #main.size144, "", [size.144mb], [radiobutton8Reset], 22, 186, 15, 15 radiobutton #main.size365kb, "", [size.365kb], [radiobutton9Reset], 22, 211, 15, 15 radiobutton #main.sizeother, "", [size.other], [radiobutton10Reset], 118, 186, 15, 15 open "File Splitter for LB" for graphics_nsb_nf as #main blue=256 print #main, "down; size 5" for y = 0 to 310 step 5 blue=blue - 5:if blue<0 then blue=0 print #main, "color 0 0 ";str$(blue) y$=str$(y) line$="line 0 "+y$+" 264 "+y$ print #main, line$ next y print #main, "flush" print #main.size144, "set" print #main, "trapclose [end.it]" print #main, "font Times_New_Roman_Bold 6 14" print #main.filetosplit, "!font Times_New_Roman 5 14" print #main.directory, "!font Times_New_Roman 5 14" print #main.sizeotherbox, "!font Times_New_Roman 5 14" print #main.directory,directory$ print #main, "color white; backcolor darkblue;" print #main, "up; goto 21 38; down; backcolor blue" print #main, "\File to split:" print #main, "up; goto 21 110; down; backcolor darkblue" print #main, "\Destination directory:" print #main, "up; goto 21 175; down; backcolor black" print #main, "\Select split file size:" print #main, "up; goto 39 195; down; backcolor black" print #main, "\1.44 MB" print #main, "up; goto 39 220; down;backcolor black" print #main, "\365 KB" print #main, "flush" [input.loop] input a$ goto [input.loop] [select.file] filedialog "Select file to split into 1.44MB pieces:","c:\temp\*.*",file.to.split$ if file.to.split$="" then goto [input.loop] file.to.split$=lower$(file.to.split$) print #main.filetosplit, file.to.split$ goto [input.loop] [size.144mb] size=1440000 goto [input.loop] [size.365kb] size=365000 goto [input.loop] [size.other] prompt "Other file size:"+chr$(13)+"Enter file size in KB:";size$ if size$="" then goto [input.loop] size=val(size$) if size=0 then size=1440000: print #main.size144, "set": goto [input.loop] size=size*1000 print #main.sizeotherbox,str$(size/1000);" KB" goto [input.loop] [select.directory] directory$="c:\temp\" filedialog "Select destination directory:","join.bat",dirinput$ if dirinput$="" then goto [input.loop] directory$=lower$(mid$(dirinput$,1,len(dirinput$)-8)) print #main.directory,directory$ goto [input.loop] [split.file] print #main.directory,"!contents?" input #main.directory,directory$ print #main.filetosplit,"!contents?" input #main.filetosplit,file.to.split$ if file.to.split$="" then notice "File Error"+chr$(13)+"No file specified!":goto [input.loop] if directory$="" then notice "Directory Error"+chr$(13)+"No directory specified!":goto [input.loop] [get.file.name] x=len(file.to.split$) z = z+1 test$=mid$(file.to.split$,x-z,1) if test$="\" then goto [continue.splitting] goto [get.file.name] [continue.splitting] name$=right$(file.to.split$,z) source.directory$=left$(file.to.split$,x-z) gosub [check.directory] if errorflag=1 then errorflag=0: goto [input.loop] gosub [check.file.to.split] if errorflag=1 then errorflag=0: goto [input.loop] z=-1 open file.to.split$ for input as #1 length=lof(#1) divisions=int(length/size) lastbit=length-divisions*size if length