Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Different behavior of fopen("w") under freedos and msdos? (Developers)

posted by RayeR Homepage, CZ, 16.03.2011, 00:55

Hi,
I tested my program (compiled in djgpp) on write-protected floppy and found there's very different behavior what happen if run under msdos and freedos 2038.
Under msdos I got null pointer as expected according to ansi c spec. If I then tried to write to NULL by fwrite() program crashed.
Under freedos it opened something (NUL device?) and fopen returned a valid pointer. fwrite() didn't crashed, fclose() didn't return error. But of course file was not created. I think this is a bad idea because application may confuse user with notification that file was successfully created blabla and it isn't. I would suggest to return null as ususal...

---
DOS gives me freedom to unlimited HW access.

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 258 users online (0 registered, 258 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum