From owner-FreeBSD-users-jp@jp.FreeBSD.org Sat Nov  4 19:03:09 2006
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id kA4A39D93452;
	Sat, 4 Nov 2006 19:03:09 +0900 (JST)
	(envelope-from owner-FreeBSD-users-jp@jp.FreeBSD.org)
Received: from t-mta7.odn.ne.jp (mfep7.odn.ne.jp [143.90.131.185])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with ESMTP/inet id kA4A39w93446
	for <FreeBSD-users-jp@jp.freebsd.org>; Sat, 4 Nov 2006 19:03:09 +0900 (JST)
	(envelope-from n-kogane@syd.odn.ne.jp)
Received: from kcesx30.koganemaru.co.jp ([220.212.167.202])
          by t-mta7.odn.ne.jp with ESMTP
          id <20061104100307884.DSBV.5871.t-mta7.odn.ne.jp@mta7.odn.ne.jp>
          for <FreeBSD-users-jp@jp.freebsd.org>;
          Sat, 4 Nov 2006 19:03:07 +0900
Received: by kcesx30.koganemaru.co.jp (Postfix, from userid 100)
	id 1D38B2841D; Sat,  4 Nov 2006 19:03:02 +0900 (JST)
To: FreeBSD-users-jp@jp.FreeBSD.org
In-Reply-To: <454C55BD.000003.22283@webmail11.yandex.ru>
Message-Id: <20061104100302.1D38B2841D@kcesx30.koganemaru.co.jp>
From: n-kogane@syd.odn.ne.jp (Nobuyuki Koganemaru)
Reply-To: FreeBSD-users-jp@jp.FreeBSD.org
Precedence: list
Date: Sat, 4 Nov 2006 19:03:02 +0900
X-Sequence: FreeBSD-users-jp 90130
Subject: [FreeBSD-users-jp 90130] Re: Yet another magic symlinks implementation
Sender: owner-FreeBSD-users-jp@jp.FreeBSD.org
X-Originator: n-kogane@syd.odn.ne.jp
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+060209

$B>.6b4]$G$9!#(B

freebsd-hackers $B$G%^%8%C%/(B symlink $B$r<BAu$7$?$H!"$"$j$^$7$?$N$G!"(B
$B%^%K%e%"%k$rK]Lu$7$F$_$^$7$?!#(B

$B$I$N$h$&$K;H$&$N$G$7$g$&$+(B?

>From owner-freebsd-hackers@freebsd.org  Sat Nov  4 18:17:18 2006
>Date: Sat, 4 Nov 2006 11:56:29 +0300 (MSK)
>From: "Andrey V. Elsukov" <bu7cher@yandex.ru>
>To: freebsd-hackers@freebsd.org
>Cc: jwd@freebsd.org, xdivac02@stud.fit.vutbr.cz, joel@freebsd.org
>Subject: Yet another magic symlinks implementation
>Reply-To: bu7cher@yandex.ru
>
>Hi, All!
>
>I've ported NetBSD magic symlinks implementation to FreeBSD.
>The description of magiclinks can been found here:
>http://www.daemon-systems.org/man/symlink.7.html
>
>Patch here:
>http://butcher.heavennet.ru/patches/kernel/magiclinks/
>
>-- 
>WBR, Andrey V. Elsukov

---- $B$3$3$+$i(B ----
SYMLINK(7)          NetBSD Miscellaneous Information Manual         SYMLINK(7)

NAME
     symlink -- symbolic link handling

DESCRIPTION
     Symbolic links are files that act as pointers to other files.  To under-
     stand their behavior, you must first understand how hard links work.

     $B>JN,!#(B

MAGIC SYMLINKS
     Symlinks in file systems with the MNT_MAGICLINKS flag set have ``magic''
     patterns in symlinks expanded. Those patterns begin with ``@'' (an
     at-sign), and end at the end of the pathname component (i.e. at the next
     ``/'', or at the end of the symbolic link if there are no more slashes).
     MNTXMAGICLINKS $B%U%i%0$,@_Dj$5$l$?%U%!%$%k%7%9%F%`$N(B Symlinks $B$O(B
     symlinks $B$N3HD%$G(B ``magic'' $B%Q%?!<%s$,$"$j$^$9!#(B
     $B$=$l$i$N%Q%?!<%s$O!"(B``@'' $B$G;O$^$j(B ($B%"%C%H%5%$%s(B)$B!"%Q%9L>%3%s%]!<%M%s(B
     $B%H$N=*$j$G=*$o$j$^$9(B ($B$9$J$o$A!"<!$N(B ``/'' $B$G$+!"$=$l0J>e$N%9%i%C%7%e(B
     $B$,$J$$$J$i%7%s%\%j%C%/$N=*$o$j$G(B)$B!#(B

     To illustrate the pattern matching rules, assume that ``@foo'' is a valid
     magic string:
     $B%Q%?!<%s%^%C%A%s%05,B'$rNc>Z$9$k$K$O!"(B``@foo'' $B$,M-8z$J%^%8%C%/J8;zNs(B
     $B$G$"$k$3$H$r2>Dj$7$^$9(B:

           @foo           would be matched
           @foo/bar       would be matched
           bar@foo        would be matched
           @foobar        would not be matched

     Magic strings may also be delimited with `{' and `}' characters, allowing
     for more complex patterns in symbolic links such as:
     $B$^$?!"%^%8%C%/J8;zNs$O!"<!$N$h$&$J%7%s%\%j%C%/%j%s%/$N$h$jJ#;($J%Q%?(B
     $B!<%s$r9MN8$7$F(B `{' $B$H(B `}' $BJ8;z$G6h@Z$k$3$H$,$G$-$^$9(B:

           @{var1}-@{var2}.@{var3}

     The following patterns are supported:
     $B<!$N%Q%?!<%s$,%5%]!<%H$5$l$F$$$^$9(B:

     @domainname    Expands to the machine's domain name, as set by
                    setdomainname(3).
		    setdomainname(3) $B$K$h$C$F@_Dj$5$l$k$h$&$K%^%7%s$N%I%a(B
		    $B%$%sL>$KE83+$7$^$9!#(B

     @hostname      Expands to the machine's host name, as set by
                    sethostname(3).
		    sethostname(3) $B$K$h$C$F@_Dj$5$l$k$h$&$K%^%7%s$N%[%9%H(B
		    $BL>$KE83+$7$^$9!#(B

     @emul          Expands to the name of the current process's emulation.
		    $B8=:_$N%W%m%;%9$N$N%(%_%e%l!<%7%g%s$NL>A0$KE83+$7$^$9!#(B

     @kernel_ident  Expands to the name of the config(1) file used to generate
                    the running kernel.
		    $B<B9TCf$N%+!<%M%k$r@8@.$9$k$?$a$K;HMQ$5$l$k(B config(1)
		    $B%U%!%$%k$NL>A0$KE83+$7$^$9!#(B

     @machine       Expands to the value of MACHINE for the system (equivalent
                    to the output of ``uname -m'').
                    $B%7%9%F%`(B (``uname -m'' $B$N=PNO$KF1Ey$J(B) $B$N$?$a$K(B
                    MACHINE $B$NCM$KE83+$7$^$9!#(B

     @machine_arch  Expands to the value of MACHINE_ARCH for the system
                    (equivalent to the output of ``uname -p'').
                    $B%7%9%F%`(B (``uname -p'' $B$N=PNO$KF1Ey$J(B) $B$N$?$a$K(B
                    MACHINEXARCH $B$NCM$KE83+$7$^$9!#(B

     @osrelease     Expands to the operating system release of the running
                    kernel (equivalent to the output of ``uname -r'').
                    $B<B9TCf$N%+!<%M%k(B (``uname -r'' $B$N=PNO$KF1Ey$J(B) $B$N%*%Z(B
                    $B%l!<%F%#%s%0%7%9%F%`$N%j%j!<%9$KE83+$7$^$9!#(B

     @ostype        Expands to the operating system type of the running kernel
                    (equivalent to the output of ``uname -s'').  This will
                    always be ``NetBSD'' on NetBSD systems.
		    $B<B9TCf$N%+!<%M%k(B (``uname -s'' $B$N=PNO$KF1Ey$J(B) $B$N%*%Z(B
		    $B%l!<%F%#%s%0%7%9%F%`%?%$%W$KE83+$7$^$9!#(B
		    $B$3$l$O!"(BNetBSD $B%7%9%F%`>e$G$O>o$K(B "NetBSD" $B$G$7$g$&!#(B

SEE ALSO
     chflags(1), chgrp(1), chmod(1), cp(1), du(1), find(1), ln(1), ls(1),
     mv(1), pax(1), rm(1), tar(1), uname(1), chown(2), execve(2), lchflags(2),
     lchmod(2), lchown(2), lstat(2), lutimes(2), mount(2), readlink(2),
     rename(2), symlink(2), unlink(2), fts(3), remove(3), chown(8), mount(8)

NetBSD 4.0                       June 23, 2005                      NetBSD 4.0

$B(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(B
Site Driven by NetBSD
---- $B$3$3$^$G(B ----

--
($BM-(B)$B>.6b4]%3%s%T%e!<%?%(%s%8%K%"%j%s%0%5!<%S%9(B ($BJ!2,8)BgLn>k;T(B)
	$B>.6b4](B $B?.9,(B (Nobuyuki Koganemaru)
E-Mail: n-kogane@syd.odn.ne.jp
E-Mail: kogane@jp.FreeBSD.org
E-Mail: kogane@koganemaru.co.jp
URL: http://www.koganemaru.co.jp
