Forum
esxDos file open for write - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Help & Support (https://www.boriel.com/forum/forumdisplay.php?fid=16)
+---- Thread: esxDos file open for write (/showthread.php?tid=879)



esxDos file open for write - nihirash - 05-10-2019

Hello!

I'm trying make scl2trd tool for esxDos.

I did:
Code:
InputStream = ESXDosOpen(InputFile$ + ".SCL", EDOS_FMODE_READ)

if (InputStream = -1) then
    print "Failed to open file"
    ESXDosClose(InputStream)
    stop
end if
VerifyScl(InputStream)

' Creating TRD-file where it will be written
OutputStream = ESXDosOpen(InputFile$ + ".TRD", EDOS_FMODE_WRITE | EDOS_FMODE_CREATE_AL)
print "IS: "; InputStream
print "OS: "; OutputSream

InputStream are defined and I can read data from it. But output stream always equals zero and when I try to write something in it 0 - there return 65536 value(I think this is -1 - error code).

But, file was created! It's empty, but exists on sd card.

I'm tested it only via ZEsarUX emulator with ZX-Uno emulated.

Does anybody know where may be issue?


Re: esxDos file open for wrtie - boriel - 05-15-2019

Can you try without the EDOS_FMODE_WRITE when creating a file??

Code:
OutputStream = ESXDosOpen(InputFile$ + ".TRD", EDOS_FMODE_CREATE_AL)

Try that and tell me. :roll:


Re: esxDos file open for wrtie - nihirash - 05-15-2019

Already written with Z88DK C.

And there it works: https://github.com/nihirash/esxdos-scl2trd-dot/blob/master/scl2trd.c

BTW mine esxDos enabled FPGA board goes mad and now I paused all esxDos development until Zx-Uno arrives to me.