How SDK:/Local/C/cat works? [SOLVED]
Posted: Fri Jan 31, 2025 7:33 am
Hello,
I have bug with 'cat' when running on my new Shell without parameter and when input terminated with a line without a new line (character).
I was wondering how cat works internally ?
I have the trouble with my Shell only and not in AmigaShell. Perhaps I forgot something on ACTION_WRITE (somewhere a null) because without no new line at the end of the input, cat displays the content of the file and keep going on trash the screen with 'garbage' characters.
It works fine with a getchar() putchar() program.
Perhaps, cat use bloc by bloc output but my ACTION_WRITE needs a null at the end of bloc/line.
example : cat <filewithnoNewlineAtEnd
Works fine with AmigaShell
But none on my Shell (limit 4096 chars on Read) perhaps cat reads a bloc more than 4Ko ?
I’m lost!
Thank you,
DGILLES
I have bug with 'cat' when running on my new Shell without parameter and when input terminated with a line without a new line (character).
I was wondering how cat works internally ?
I have the trouble with my Shell only and not in AmigaShell. Perhaps I forgot something on ACTION_WRITE (somewhere a null) because without no new line at the end of the input, cat displays the content of the file and keep going on trash the screen with 'garbage' characters.
It works fine with a getchar() putchar() program.
Perhaps, cat use bloc by bloc output but my ACTION_WRITE needs a null at the end of bloc/line.
example : cat <filewithnoNewlineAtEnd
Works fine with AmigaShell
But none on my Shell (limit 4096 chars on Read) perhaps cat reads a bloc more than 4Ko ?
I’m lost!
Thank you,
DGILLES