Here is an example when "capturing" this information could be useful.
Suppose you have a file foo.mw which contains the definition of a module named foo and a command
You execute the worksheet foo.mw at date T.
How can you be 100% sure that the foo.mla you use at date T' > T has been created from the foo.mw that existed at time T?
To answer this question I decided years ago to "programatically capture" the name of the worksheet foo.mw within this procedure, its modifaction (through FileTools) and the name of the operator (ssystem("whoami")) and augment the archive foo.mla with the informations.
Taches := ssystem("tasklist /V /FO ""LIST"" "):
MaTache := StringTools:-StringSplit(Taches, "javaw.exe"):
MaTache := StringTools:-StringSplit(%, "Maple 2019"):
MaTache := StringTools:-Squeeze(MaTache):
MaTache := StringTools:-StringSplit(MaTache, "fenËtre: "):
MyWS := StringTools:-StringSplit(MaTache, "*"):
MyWS := StringTools:-SubstituteAll(MyWS, "\\", "/"):
WSepoch := FileTools[ModificationTime](MyWS):
Seed := randomize():
GenID := StringTools:-Random(20, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"):
INFO := table([
"CreationDate" = StringTools[FormatTime]("%Y.%m.%d_%H.%M.%S"),
"WorksheetName" = MyWS,
"WorksheetEpochTime" = WSepoch,
"Author" = op(-1, ssystem("whoami"))
By the time I couldn't find any versioning tools that were secure enough to guarantee the link between foo.mw and foo.mla.
The weak link in my strategy is that you heve to save foo.mw before executing it and thus creating foo.mla.