lkml.org 
[lkml]   [2004]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Program-invoking Symbolic Links?
Good morning, John,
(My apologies for floating offtopic for kernel programming. I
wanted to provide a quick example for John and others interested in doing
this so they could see this can be done outside of the kernel.)

On Thu, 5 Aug 2004, John M Collins wrote:

> (Please CC any reply to jmc AT xisl.com as I'm not subbed - thanks).
>
> I wondered if anyone had ever thought of implementing an alternative form of
> symbolic link which was in fact an invocation of a program?
>
> Such a symbolic link would "do all the necessary" to fork off a new process
> running the specified program with input or output from or to a pipe
> depending on whether the link was opened for writing or reading respectively.
> RW access would probably have to be banned and the link would usually be
> read-only or write-only.
>
> What I originally wanted was symbolic links (with "=>" as a possible
> notation).
>
> latest_version.tar => "tar cf - /latest/and/greatest"
> latest_version.tgz => "gzip -c latest_version"
>
> and the like, which I could link on a website so I didn't have to run around
> updating tar files/zip files/gzipped tar files etc each time I fix a bug in
> some package.

Is there any reason this couldn't be done in userspace by using
named pipes instead of a new form of symlink?

#!/bin/bash

if [ ! -e livepipe ]; then
echo Making livepipe >&2
mkfifo livepipe
fi

while : ; do
echo -n . >&2
( date ) >livepipe
sleep 1
done


Run this, and then from another window, simply do:
cat livepipe
To see the date, or whatever output is provided by the subshell.
I'd like to sincerely request that further discussion _not_
continue on linux-kernel - please respond privately.
Cheers,
- Bill

---------------------------------------------------------------------------
"Eagles may soar, high and proud, but weasels don't get sucked
into jet engines."
(Courtesy of Mike Andrews <mandrews@termfrost.org>)
--------------------------------------------------------------------------
William Stearns (wstearns@pobox.com). Mason, Buildkernel, freedups, p0f,
rsync-backup, ssh-keyinstall, dns-check, more at: http://www.stearns.org
--------------------------------------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.062 / U:0.960 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site