Hi all,
I'm writing a program to manipulate disk image files that will be used with retro computer emulators. My program loads the disk image into a TMemoryStream with LoadFromFile, does some operation on it, such as list, read or write files. Once the operation is complete, if it was a write it attempts to use SaveToFile to write it back to the disk file.
This unfortunately seems to lead to a EFCreateError about 25% of the time. The odd thing is if I retry the operation it will work. The file is not read only (as it was created initially by my program anyway). Also annoyingly if I run the program in Lazarus, single stepping it always works
My environment is Windows 7 x64, Lazarus 1.8.0. FPC 3.0.4. I don't currently have any addon components, so just a vanilla Lazarus install.
Anyone have any clues as to what is going on here?
My test batch file :
dfsdisk create test.ssd -t 80 -q $20
dfsdisk write test.ssd -f ../System-ROM/FORM40 -q $20 -l $2800 -e $2800
dfsdisk write test.ssd -f ../System-ROM/FORM80 -q $20 -l $2800 -e $2800
dfsdisk write test.ssd -f ../System-ROM/VERIFY4 -q $20 -l $2800 -e $2800
dfsdisk write test.ssd -f ../System-ROM/VERIFY8 -q $20 -l $2800 -e $2800
My Test output :
C:\Users\phill\Dropbox\AtomDOS\DFSDisk>test
C:\Users\phill\Dropbox\AtomDOS\DFSDisk>dfsdisk create test.ssd -t 80 -q $20
Created image file test.ssd, title , qual , opt 0
C:\Users\phill\Dropbox\AtomDOS\DFSDisk>dfsdisk write test.ssd -f ../System-ROM/FORM40 -q $20 -l $2800 -e $2800
StreamIn.size=512
Saving to test.ssd
Wrote file ../System-ROM/FORM40 to DFS:FORM40 on image test.ssd
C:\Users\phill\Dropbox\AtomDOS\DFSDisk>dfsdisk write test.ssd -f ../System-ROM/FORM80 -q $20 -l $2800 -e $2800
StreamIn.size=512
Saving to test.ssd
Exception at 00411191: EFCreateError:
Unable to create file "test.ssd".
C:\Users\phill\Dropbox\AtomDOS\DFSDisk>dfsdisk write test.ssd -f ../System-ROM/VERIFY4 -q $20 -l $2800 -e $2800
StreamIn.size=294
Saving to test.ssd
Wrote file ../System-ROM/VERIFY4 to DFS:VERIFY4 on image test.ssd
C:\Users\phill\Dropbox\AtomDOS\DFSDisk>dfsdisk write test.ssd -f ../System-ROM/VERIFY8 -q $20 -l $2800 -e $2800
StreamIn.size=294
Saving to test.ssd
Exception at 00411191: EFCreateError:
Unable to create file "test.ssd".
Cheers.
Phill.