[Z88dk-users] File IO in CP/M using newlib

Bridge to the z88dk-users mailing list
Post Reply
ed
New member
Posts: 1
Joined: Mon Jul 17, 2017 5:27 pm

[Z88dk-users] File IO in CP/M using newlib

Post by ed »

Hi, I'm writing a CP/M program using newlib and would like to read/write files.

I understand that fopen isn't currently implemented in newlib, (I tried it and get "symbol 'asm_target_open_p1' not defined"), what's the best way to open read/write files in CP/M with newlib? Am I better off reverting to the classic lib?

Thanks!
Ed



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

Hi, I'm writing a CP/M program using newlib and would like to read/write files.

I understand that fopen isn't currently implemented in newlib, (I tried it and get "symbol 'asm_target_open_p1' not defined"), what's the best way to open read/write files in CP/M with newlib? Am I better off reverting to the classic lib?
Yes unfortunately disk io through stdio is not going to work in newlib. I'm hoping to complete disk io this summer. From within newlib the only way you are going to be able to do disk io is to call the cpm bdos directly from assembler.

Classic lib will do file io if you need it.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Post Reply