[Toybox] Maybe a ln addition if possible?

Rob Landley rob at landley.net
Thu Jan 23 22:55:35 PST 2020


On 1/23/20 7:31 PM, scsijon wrote:
> I know this is not in the Posix 'ln' standard at present, or really a toybox
> problem, but i'm becoming frustrated with the number of links i'm having to
> manually recreate when a set of script source files has it's version changed
> after being ammended.
> 
> As an example:
> 
> source file is akdjagh-1.2.34, a version 1.2.34 of akdjagh
> the created link is the shortened name of akdjagh

Ok...

> as time goes on the version of akdjagh changes to akdjagh-1.2.45,
> it's the same file, just with additions, it's not as if it's being replaced with
> a completely new file!

Define "changes". Somebody deleted the old 1.2.34 and made a new 1.2.45
filename. Who?

> and the link dies....

Symlinks do not wildcard expand, no.

> Is there a way of having this not happen or deal with it somehow?

Who's _doing_ it? (A package manager?)

> Surely others come across this problem.

You could have a "ln akdjagh; ln -s akdjagh-* akdjagh" script? Then the shell
would wildcard expand at the time and create the new symlink?

Not sure I understand the problem. Changing the ln command probably wouldn't
help because it boils down to a syscall that creates a "this name -> that name"
mapping in the kernel's dentry layer, which is a "when this is resolved, go look
at this other specific name" that only even gets loaded when you resolve the
first name, and then only looks at the second specific name (which doesn't even
have to be there for the link to be created)...

The ln command could check that the destination exists when it creates the
target link, but it's not even running when the destination file later changes...

> thanks

Rob



More information about the Toybox mailing list