LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: Is there a 
@ 2008-02-14  9:44 Tom Van Looy
  2008-02-14 12:14 ` Mika Lawando
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Van Looy @ 2008-02-14  9:44 UTC (permalink / raw)
  To: rzryyvzy, linux-kernel

You can create a symlink to /dev/null and name it whatever you want?

$ ln -s /dev/null tempfile
$ echo blablabla > tempfile
$ wc tempfile
0 tempfile




>----- Oorspronkelijk bericht -----
>Van: rzryyvzy [mailto:rzryyvzy@trashmail.net]
>Verzonden: donderdag, februari 14, 2008 10:30 AM
>Aan: linux-kernel@vger.kernel.org
>Onderwerp: Is there a "blackhole" /dev/null directory?
>
>Hello Linux Kernel Hackers,
>
>/dev/null is often very useful, specially if programs force to save data in some file. But some programs like to creates different temporary file names, so /dev/null could no more work.
>
>What is with a "/dev/null"-directory?
>I mean a "blackhole pseudo directory" which eats every write to null.
>
>Here is how it could work:
>mount -t nulldir nulldir /dev/nulldir
>
>Now if a program does a create(2),
>it creates in the memory the file with its fd.
>Then if a program does a write(2) to the fd, it eats the writes and give out fakely it has written the number of bytes.
>When the program calls does a close(2) of the fd, then the complete inode is deleted in the memory.
>
>The directory should  be permanently empty except for the inodes with open file descriptors. So only inode information would be temporary saved in this "nulldir tmpfs" directory.
>
>Is there already existing a possibility to create a null directory?
>-- 
>Best regards,
>Mika Lawando
>
>-- 
>E-Mail sent with anti-spam site TrashMail.net!
>Free disposable email addresses: http://www.trashmail.net/
>--
>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/
>
>
>



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Is there a
  2008-02-14  9:44 Is there a Tom Van Looy
@ 2008-02-14 12:14 ` Mika Lawando
  0 siblings, 0 replies; 2+ messages in thread
From: Mika Lawando @ 2008-02-14 12:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: assarix

Tom Van Looy schrieb:
> You can create a symlink to /dev/null and name it whatever you want?
>
> $ ln -s /dev/null tempfile
> $ echo blablabla > tempfile
> $ wc tempfile
> 0 tempfile
>   
The problem is, what do you do if the filename would be:
tempfile.<TIMESTAMP>

where <TIMESTAMP> is replaced by the unix timestamp. I mean how do you 
redirect to /dev/null if you don't know in advance the filename your 
application will create.

Its true the quick way would be to write a filesystem in Perl with fuse. 
But it would be better to implement this natively in the kernel, because 
there is a loss of performance in fuse between the communication of the 
fuse client and the fuser server (it uses a socket mechanism).

-- 
Best regards,
Mika Lawando


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-14 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-14  9:44 Is there a Tom Van Looy
2008-02-14 12:14 ` Mika Lawando

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).