* [gentoo-user] How can I create "dynamic" link?
@ 2010-08-10 21:06 Jarry
2010-08-10 21:56 ` [gentoo-user] " Nikos Chantziaras
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Jarry @ 2010-08-10 21:06 UTC (permalink / raw
To: gentoo-user
Hi,
I am facing this problem: I have subdirectory, let's say
"/some/dir". I would like to create some kind of "dynamic"
and "preliminary" link, so that any future subdirectories,
created later in /some will in fact be links, pointing to
/some/dir.
So if later any user does:
cd /some
mkdir whatever
There should not be subdirectory /some/whatever, but actually link:
/some/whatever -> /some/dir
Is it possible?
Jarry
--
_______________________________________________________________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gentoo-user] Re: How can I create "dynamic" link?
2010-08-10 21:06 [gentoo-user] How can I create "dynamic" link? Jarry
@ 2010-08-10 21:56 ` Nikos Chantziaras
2010-08-10 22:09 ` [gentoo-user] " Bill Longman
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Nikos Chantziaras @ 2010-08-10 21:56 UTC (permalink / raw
To: gentoo-user
On 08/11/2010 12:06 AM, Jarry wrote:
> Hi,
> I am facing this problem: I have subdirectory, let's say
> "/some/dir". I would like to create some kind of "dynamic"
> and "preliminary" link, so that any future subdirectories,
> created later in /some will in fact be links, pointing to
> /some/dir.
>
> So if later any user does:
> cd /some
> mkdir whatever
>
> There should not be subdirectory /some/whatever, but actually link:
> /some/whatever -> /some/dir
>
> Is it possible?
mkdir creates directories, not links. You need to do "ln -s /some/dir
/some/whatever". Having mkdir create links would be a bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] How can I create "dynamic" link?
2010-08-10 21:06 [gentoo-user] How can I create "dynamic" link? Jarry
2010-08-10 21:56 ` [gentoo-user] " Nikos Chantziaras
@ 2010-08-10 22:09 ` Bill Longman
2010-08-11 6:54 ` Alan McKinnon
2010-08-10 22:18 ` Lanikai
2010-08-11 3:12 ` [gentoo-user] " Grant Edwards
3 siblings, 1 reply; 6+ messages in thread
From: Bill Longman @ 2010-08-10 22:09 UTC (permalink / raw
To: gentoo-user
On 08/10/2010 02:06 PM, Jarry wrote:
> Hi,
> I am facing this problem: I have subdirectory, let's say
> "/some/dir". I would like to create some kind of "dynamic"
> and "preliminary" link, so that any future subdirectories,
> created later in /some will in fact be links, pointing to
> /some/dir.
>
> So if later any user does:
> cd /some
> mkdir whatever
>
> There should not be subdirectory /some/whatever, but actually link:
> /some/whatever -> /some/dir
>
> Is it possible?
Unless you write your own kernel module, the answer is "No."
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] How can I create "dynamic" link?
2010-08-10 21:06 [gentoo-user] How can I create "dynamic" link? Jarry
2010-08-10 21:56 ` [gentoo-user] " Nikos Chantziaras
2010-08-10 22:09 ` [gentoo-user] " Bill Longman
@ 2010-08-10 22:18 ` Lanikai
2010-08-11 3:12 ` [gentoo-user] " Grant Edwards
3 siblings, 0 replies; 6+ messages in thread
From: Lanikai @ 2010-08-10 22:18 UTC (permalink / raw
To: gentoo-user
On 08/10/2010 11:06 PM, Jarry wrote:
> Hi,
> I am facing this problem: I have subdirectory, let's say
> "/some/dir". I would like to create some kind of "dynamic"
> and "preliminary" link, so that any future subdirectories,
> created later in /some will in fact be links, pointing to
> /some/dir.
>
> So if later any user does:
> cd /some
> mkdir whatever
>
> There should not be subdirectory /some/whatever, but actually link:
> /some/whatever -> /some/dir
>
> Is it possible?
>
> Jarry
>
Hello,
this is probably not an answer for your question but... You can achieve
this in different way - write small script and after this use some
program (for example cron) which will execute that script every few
seconds/minutes. The script may remove every empty directory located in
/some (excluding /some/dir) and create a link to it.
Regards, Paul.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gentoo-user] Re: How can I create "dynamic" link?
2010-08-10 21:06 [gentoo-user] How can I create "dynamic" link? Jarry
` (2 preceding siblings ...)
2010-08-10 22:18 ` Lanikai
@ 2010-08-11 3:12 ` Grant Edwards
3 siblings, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2010-08-11 3:12 UTC (permalink / raw
To: gentoo-user
On 2010-08-10, Jarry <mr.jarry@gmail.com> wrote:
> I am facing this problem: I have subdirectory, let's say
> "/some/dir". I would like to create some kind of "dynamic"
> and "preliminary" link, so that any future subdirectories,
> created later in /some will in fact be links, pointing to
> /some/dir.
Short answer: you can't do that.
Long answer: tell us what problem you're really facing (for which you
think "dynamic link" is a solution), and we'll try to help you solve
it.
--
Grant
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] How can I create "dynamic" link?
2010-08-10 22:09 ` [gentoo-user] " Bill Longman
@ 2010-08-11 6:54 ` Alan McKinnon
0 siblings, 0 replies; 6+ messages in thread
From: Alan McKinnon @ 2010-08-11 6:54 UTC (permalink / raw
To: gentoo-user; +Cc: Bill Longman
On Wednesday 11 August 2010 00:09:13 Bill Longman wrote:
> On 08/10/2010 02:06 PM, Jarry wrote:
> > Hi,
> > I am facing this problem: I have subdirectory, let's say
> > "/some/dir". I would like to create some kind of "dynamic"
> > and "preliminary" link, so that any future subdirectories,
> > created later in /some will in fact be links, pointing to
> > /some/dir.
> >
> > So if later any user does:
> > cd /some
> > mkdir whatever
> >
> > There should not be subdirectory /some/whatever, but actually link:
> > /some/whatever -> /some/dir
> >
> > Is it possible?
>
> Unless you write your own kernel module, the answer is "No."
The slightly longer answer is that the idea, as presented, is stupid. Looks
like a foolish grasp at a "solution" for a "problem".
If the OP wants a link in /some/ he needs to make one using ln
If the OP wants a subdir in /some/ he needs to make one using mkdir
There is no magic way to turn one into the other because they are different.
It appears to me that he finds things like /some/otherdir/ that should never
have been created at all and their contents should have gone into /some/dir/
instead. There's an easy solution to that:
remove write permission from /some/ and add it to /some/dir/ for all users
that write to /some/dir/. They can't create the wrong directories without
permissions.
--
alan dot mckinnon at gmail dot com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-08-11 7:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-10 21:06 [gentoo-user] How can I create "dynamic" link? Jarry
2010-08-10 21:56 ` [gentoo-user] " Nikos Chantziaras
2010-08-10 22:09 ` [gentoo-user] " Bill Longman
2010-08-11 6:54 ` Alan McKinnon
2010-08-10 22:18 ` Lanikai
2010-08-11 3:12 ` [gentoo-user] " Grant Edwards
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox