bug400 / lifutils

utilites for Hewlett Packard LIF files
GNU General Public License v2.0
20 stars 4 forks source link

Minor fixes #3

Closed dl8dtl closed 5 years ago

dl8dtl commented 5 years ago

Various minor fixes to allow building on FreeBSD (and possibly other non-Linux and non-Apple unixoid systems). Also fixed a serious case of undefined behaviour complained by my compiler.

bug400 commented 5 years ago

Tank you for improving the LIFUTILS! I agree with your proposals with the exception of allowing underscores in file names. The main application of the LIFUTILS is file management for the calculators HP-41, HP-71 and HP-75. The HP-71 and HP-75 only allow file names consisting of letters and digits starting with a letter. Do you have other applications in mind?

dl8dtl commented 5 years ago

I've got a couple of LIF-formatted floppy disks containing calibration data for an older HP network analyzer. Some of the files were named like "MA_FILE1" etc.

I've seen LIFUTILS are primarily targeted for older HP calculators. Yet, I think they are useful enough for other LIF media as well. The original HP LIFutils (still available at Keysight), after all, failed to handle the floppies I got (they didn't tell me why), so reading a physical image (on FreeBSD in my case) and using these LIFUTILS eventually made them accessible.

bug400 commented 5 years ago

I see: the HP-UX LIF utlities support underscores in filenames as well. I'd like to keep the original behaviour of the LIFUTIS concerning file name checking. I'll put on the backlog to relax file name checking with an additional program switch for the next release and adopt the other commits. The new switch is needed for the programs "lifget", "lifput", "lifpurge", "lifrename" and "textlif".

dl8dtl commented 5 years ago

Attached are the floppy images I've got, just for reference. Feel free to add them to the repository if desired. Note that the text files (found in floppy3.lif) there are also a bit special: the actual text part follows the conventions mentioned in liftext. However, there's a 32-byte header in front of that, starting with the filename itself. No idea about their purpose. In order to convert them, I cut off the header with "dd" before feeding them into liftext for conversion.

lif-floppies.zip

dl8dtl commented 5 years ago

I see: the HP-UX LIF utlities support underscores in filenames as well. I'd like to keep the original behaviour of the LIFUTIS concerning file name checking. I'll put on the backlog to relax file name checking with an additional program switch for the next release and adopt the other commits. The new switch is needed for the programs "lifget", "lifput", "lifpurge", "lifrename" and "textlif".

Maybe use an environment variable to relax the filename checking a bit? Might be easier to implement compared to another option.

bug400 commented 5 years ago

Windows and mac OS users are generally not accustomed to set environment variables. I already merged your patch in my local repository and began to implement a program switch.

bug400 commented 5 years ago

If you use lifget to extract files from an floppy image file please mind that it always extracts an LIF file with the 32 byte directory header. Use the -r option to remove it. To display a file use the following command (with your patch enabled): lifget -r floppy3.lif MA_FILE1 | liftext. The files with type 0xE961 might be HP-9000 data files.

dl8dtl commented 5 years ago

Thanks for reminding me of the -r option.

bug400 commented 5 years ago

Closed with release 1.7.9