Skip to content

Padding not written correctly when writing final Pascal TEXT block #142

@dendrown

Description

@dendrown

Hello. I have a problem with AppleCommander when writing Pascal TEXT files to a disk image. The final block is not being padded correctly. Your source file PascalTextFileFilter.java includes a description on the TEXT file format, which I have compared with my own copies the Apple Pascal Language Reference Manual (pp. 12-13) and the Apple Pascal Operating System Reference Manual (p. 266).

I have forked this repository to code this fix for this issue. The fix seems to be working correctly, and the Apple Pascal editor is now happy with the TEXT files I transfer using AppleCommander.

However, I am not yet ready to open a merge request for two reasons. Firstly, I have some debug messages in the code that you will probably want removed before a merge. More critically, I am not certain how to handle the case where the actual text completely fills the last 1024-byte page (the last byte being the final CR). Apple's documentation does not mention this corner case. Before I attempted the fix to AppleCommander, some experimentation on my own suggested that the file must end in a NULL. Requiring one final NULL means that a TEXT file would then have to end with full page of 1024 NULL bytes. After coding the fix here, I tried to force a TEXT file to a page boundary, but it always seemed that when I went to transfer the file to the disk image, the file length would bounce to a length slightly greater than the page boundary. I am not sure why.

So, I thought I would open this issue and get your input on the matter. Once my question about what to for a TEXT file that is a multiple of 1024 bytes long, I will be happy to clean up my code and submit the merge request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions