I need to create a lot of files with individual file sizes. I'm running over
a list with an underlying structure that contains the size of the original file.
Code: Select all
itemToCreate = dstFolder + ReplaceString(ScanDirInfos()\Item, srcFolder, "", #PB_String_NoCase)
If CreateFile(0, itemToCreate, #PB_File_SharedRead|#PB_File_SharedWrite|#PB_File_NoBuffering|#PB_Ascii)
For c = 1 To ScanDirInfos()\Size
WriteString(0, Chr(32), #PB_Ascii)
Next
CloseFile(0)
EndIf
It doesn't really matter what is written into the file (it doesn't need to be spaces).
Is there any efficient way (without allocating GBs of memory if a file has a size in that range) to do it quicker?