From: Bill Davidsen <davidsen@tmr.com>
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: Andi Kleen <andi@firstfloor.org>,
Jasper Bryant-Greene <jasper@unix.geek.nz>,
rzryyvzy <rzryyvzy@trashmail.net>,
linux-kernel@vger.kernel.org
Subject: Re: Is there a "blackhole" /dev/null directory?
Date: Fri, 15 Feb 2008 14:25:55 -0500 [thread overview]
Message-ID: <47B5E743.3000101@tmr.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0802141553400.694@fbirervta.pbzchgretzou.qr>
Jan Engelhardt wrote:
> On Feb 14 2008 10:46, Andi Kleen wrote:
>> Jasper Bryant-Greene <jasper@unix.geek.nz> writes:
>>> This could be done fairly trivially with FUSE, and IMHO is a good use
>>> for FUSE because since you're just throwing most data away, performance
>>> is not a concern.
>
> There is a much more interesting 'problem' with a "/dev/null directory".
>
> Q: Why would you need such a directory?
> A: To temporarily fool a program into believing it wrote something.
Also: to let a program believe it was creating files which are used to
hold the written data. Otherwise /dev/null would probably be the solution.
>
> Q: Should all files disappear? (e.g. "unlink after open")
> A: Maybe not, programs may stat() the file right afterwards and
> get confused by the "inexistence".
I think what is going to happen is that files created behave as if they
are the result of a mknod resulting in a /dev/null clone.
>
> Q: What if a program attempts to mkdir /dev/nullmnt/foo to just
> create a file /dev/nullmnt/foo/barfile?
> A: /dev/nullmnt/foo must continue to exist or be accepted for a while,
> or perhaps for eternity.
The directory structure can persist, it's the writing of data which can
be avoided.
Real example:
A program which reads log files and prepares a whole raft of reports in
a directory specified. If you just want to see the summary (stdout) and
exception notices (stderr) having a nulldir would avoid the disk space
and i/o load if you were just looking at the critical output rather than
the analysis.
Yes, if this was an original program requirement it would or should have
been a feature. Real world cases sometimes use tools in creative ways.
--
Bill Davidsen <davidsen@tmr.com>
"We have more to fear from the bungling of the incompetent than from
the machinations of the wicked." - from Slashdot
next prev parent reply other threads:[~2008-02-15 19:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-14 9:30 Is there a "blackhole" /dev/null directory? rzryyvzy
2008-02-14 9:39 ` Jasper Bryant-Greene
2008-02-14 9:46 ` Andi Kleen
2008-02-14 15:00 ` Jan Engelhardt
2008-02-14 15:19 ` Hans-Jürgen Koch
2008-02-14 15:23 ` Jan Engelhardt
2008-02-14 15:30 ` Hans-Jürgen Koch
2008-02-15 19:25 ` Bill Davidsen [this message]
2008-02-14 12:16 ` Mika Lawando
2008-02-14 15:06 ` linux-os (Dick Johnson)
[not found] <9WIJE-1Nr-11@gated-at.bofh.it>
2008-02-14 17:16 ` Bodo Eggert
[not found] ` <9WIJO-1Nr-19@gated-at.bofh.it>
[not found] ` <9WITv-286-21@gated-at.bofh.it>
[not found] ` <9WNTa-2x3-17@gated-at.bofh.it>
[not found] ` <9WOch-2Wk-3@gated-at.bofh.it>
2008-02-15 1:15 ` Bodo Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47B5E743.3000101@tmr.com \
--to=davidsen@tmr.com \
--cc=andi@firstfloor.org \
--cc=jasper@unix.geek.nz \
--cc=jengelh@computergmbh.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rzryyvzy@trashmail.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.