With following code i write an
dest : array of Bytes;
to a file.
c: integer;
size: integer;
If i do it Byte by Byte:
filename := ExePath + 'test.txt';
AssignFile(myfile, filename);
ReWrite(myfile, 1);
Write the data array to the file
for c := 0 to length(dest) - 1 do
BlockWrite(myfile, dest[c], 1);
CloseFile(myfile);
everything works fine, but takes ages on large arrays (20MB biggest).
If i try to write it @ once i get I/O Error 1784:
filename := ExePath + 'test.txt';
AssignFile(myfile, filename);
size := length(dest);
ReWrite(myfile, size);
BlockWrite(myfile, dest[0], size);
CloseFile(myfile);
Where is may fault? Thanks in advance.