List
Add
Info
Contact
Stats
To edit this entry i need username and password!
Fields marked * are required!
* Username:
* Password:
Type:
Tip (BBCode supported)
Name:
Datei kopieren
* Data:
(max. 1 MB)
Available TAG's (new window)
[code] function copy(fromfile as string, tofile as string) as integer 'eingabe öffnen Dim TInFN as Integer = FreeFile If Open(fromfile for Binary as #TInFN) <> 0 Then Return -1 'ausgabe öffnen Dim TOutFN as Integer = FreeFile If Open(tofile for Binary as #TOutFN) <> 0 Then Close #TInFN: Return -1 Dim TMax as UInteger = Lof(TInFN) 'eingabelänger ermitteln Dim TBlockSize as UShort = 8092 'blockgröse beim kopieren festlegen (je gröser, desto schneller, allerdings auch blockierender bei hintergrundeingaben) Dim TBuffer as String = Space(TBlockSize) 'speicher auf maximale blockgröse vergrössern For X as UInteger = 1 to TMax Step TBlockSize 'schleife in blockgrösenschritte durchgehen If X + TBLockSize > TMax Then TBuffer = Space(TMax - X + 1) 'wenn position + nächste blockgröse, über länger von file, dan puffer verkürzen Get #TInFN, X, T 'einlesen Put #TOutFN, X, T 'schreiben Next Close #TOutFN 'schliessen Close #TInFN '... Return 1 end function [/code]
Filetype / Highlight:
freeBASIC
Action: