Fixes in 1998/tomtorfs, add try.sh & format fixes

The author stated that the program assumes EOF is -1 but for systems
that do not have this it will fail. This is indeed a valid concern as
the standard mandates that it's a value < 0 but it doesn't require it to
be -1.

The author also stated that the program could fail if 1 is not a return
value that indicates error so this was changed to EXIT_FAILURE as the
suggested was made. It is possible of course that I missed a place where
this should have been updated but I don't believe so. I am unaware of
any system where this would be a problem and I don't know why it matters
anyway but I made the change as the author stated it could be a problem
with portability.

The README.md file has been formatted and typo checked.

Added try.sh script.

This should complete this entry's review.
This commit is contained in:
Cody Boone Ferguson committed 2023-11-12 05:10:38 -08:00
1 parent e791883029
commit 3141392cc1
4 files changed
+74 -21

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
#
# script to demonstrate 1998/tomtorfs
#
rm -f file.A file.B file.C
echo "$ echo abscond conferrable > file.A" 1>&2
echo "abscond conferrable" > file.A
echo "$ ./tomtorfs file.A 32 04C11DB7 1 FFFFFFFF FFFFFFFF" 1>&2
./tomtorfs file.A 32 04C11DB7 1 FFFFFFFF FFFFFFFF
echo "$ echo adorn condolence > file.B" 1>&2
echo "adorn condolence" > file.B
echo "$ ./tomtorfs file.B 32 04C11DB7 1 FFFFFFFF FFFFFFFF" 1>&2
./tomtorfs file.B 32 04C11DB7 1 FFFFFFFF FFFFFFFF
echo "$ echo adorn condolence too > file.C" 1>&2
echo "adorn condolence too" > file.C
echo "$ ./tomtorfs file.C 32 04C11DB7 1 FFFFFFFF FFFFFFFF" 1>&2
./tomtorfs file.C 32 04C11DB7 1 FFFFFFFF FFFFFFFF
rm -f file.A file.B file.C