recognizing !nnn version format?

1 view
Skip to first unread message

Nick Briggs

unread,
Dec 25, 2024, 6:00:33 PM12/25/24
to Lisp Core
I think it's about a 10-line fix to the local file system name parsing to have it recognize for input versioned file names of the form "name.ext!nnn" where nnn is all digits, just as it currently parses "name.ext.~nnn~".

It would never generate a new name with the old form, and if you opened "foo.bar!2" and wrote a new version it would write "foo.bar.~3~".

This would make it much easier to deal with files that are downloaded from the CHM PARC archives.

Opinions?

-- Nick

John Cowan

unread,
Dec 25, 2024, 9:50:46 PM12/25/24
to Nick Briggs, Lisp Core
That sounds backwards to me.  The !  and ~ formats should both be recognized, yes.  But nobody is writing new CHM files (I think) whereas new Emacs files are being created all the time.

--
You received this message because you are subscribed to the Google Groups "Medley Interlisp core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lispcore+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lispcore/24C8323F-4958-47BF-A0D9-D120EC52BD12%40gmail.com.

Nick Briggs

unread,
Dec 26, 2024, 1:16:20 AM12/26/24
to John Cowan, Lisp Core
I think you're misunderstanding what I proposed -- "old" is the bang-version, we'll never create a new file with that format name, new files (or new versions of old files with the bang-version format) will always get a new (sort-of emacs style) name.

While I expect most of the access to the bang-version files would be just to look at them, it's not far-fetched to imagine that someone would load an old file, fix something in it, and write out a new version.  For example:

LoadPeachAIS.cm!1 (from CHM, on local disk) looks like LoadPeachAIS.cm;1 inside Medley, if you write LoadPeachAIS.cm;2 the file on disk is named LoadPeachAIS.cm.~2~
Afterwards, if you do a "DIR LoadPeach*" you'll see LoadPeachAIS.cm;1 and LoadPeachAIS.cm;2

-- Nick

Ron Kaplan

unread,
Dec 28, 2024, 12:51:14 PM12/28/24
to Nick Briggs, John Cowan, Lisp Core
Isn’t this something that can be done fairly easily on the Lisp side, with wrappers that translate between {UNIX}-!nnn {UNIX}-~nnn~ ?

At the Maiko level, I still think it would be more useful going foward to systematically swap the version with the actionable extension.  Does that look any more feasible?

Nick Briggs

unread,
Dec 28, 2024, 4:12:32 PM12/28/24
to Ron Kaplan, John Cowan, Lisp Core
It was about 8 lines of code to implement, and being done in the Maiko DSK code means that a sequence of files with mixed syntax version numbers are treated indistinguishably, and there's no hacking required to make the PACKFILENAME code do anything weird.  If you tried to do it via the {unix} FDEV the hard link for most recent file would not be automatically maintained.

You can have (in unix land)
foo!1
foo!2
foo.~3~
foo!4
and they look like foo;1 through foo;4 as far as Lisp is concerned.

This doesn't affect whether we could put extensions after versions instead of before - that's still awkward.
Reply all
Reply to author
Forward
0 new messages