-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reusing a static FCB for several file operations #109
Comments
You do need to clear some. I don't know why they're not cleared for you. See F_OPEN here: https://www.seasip.info/Cpm/bdos.html EX, S1, S2, RC and CR are the ones specified in the documentation. S2 is cleared for you in the code but I forget why. For clearing the whole structure... memset and |
Thanks for the clarification, then it is just my poor knowledge of CP/M which is the issue. I assumed that cpm_file_close would set up the FCB used by fcb_file_open or fcb_file_create for a new file. The fcb = {} syntax is more elegant for sure. I am still getting used to these 'modern' (i.e. anything not supported by Watcom ;) ) additions to C. |
Closed by #115 |
I have an issue in vt52term, where I reuse a global static FCB struct for opening files for both sending and receiving with Xmodem. If I only open/close the files, I get strange behavior such as the file position from the previous file being remembered when opening a new file.
I currently have a working fix where I use memset to zero the entire FCB before starting a new file operation. This works fine, but is this the way it is intended to be done? I tried just setting ex to zero, but this did not solve the problem.
I guess this boils down to two questions:
The text was updated successfully, but these errors were encountered: