-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Darren New wrote:
> Christopher Smith wrote:
>> general, multiple streams on a file has proven to be a fairly
>> questionable feature.
>
> Funny how almost every file system newer than FAT32 supports it. :-) Of
> course, when most people want multiple streams on a file, they just code
> multiple files in a directory, or implement it as a library.
There are lots of useless features implemented in filesystems and other
technology components. They tend to be there because a certain specific
customer depends on them and it is easier to just have them than to
address it. Frankly, I'm with Hans Reiser on this issue: you already
have a perfectly good namespace, why introduce another orthogonal one.
>>> It also lacks the ability to clean up temp files when your program
>>> crashes or when you log out.
>>
>> openat()
>> unlinkat()
>
> Not what I meant. I meant that if I create a file in /tmp/xyz I want it
> to get unlinked for me if I dump core. Sort of like creating the file,
> unlinking it, and continuing to hold it open with no names in any
> directories pointing to it, only with a name in the directory pointing
> to it. :-)
Yeah, I was not seeing the value of having the name exposed, so the
solution I was proposing was exactly what you are describing. I'm sure
you have a specific need in mind, but generally having an exposed name
is such a security concern that it is often better NOT to have it
exposed. Of course it is always possible to do something like:
int fd = openat(dir_fd, path, O_CREAT | 0_RDWR);
if (pid_t child_pid = fork()) {
if (-1 == child_pid) {
std::cerr << "Error[" << errno << "] spawning child"
<< std::endl;
abort();
}
waitpid(child_pid, NULL, 0);
if (0 != unlinkat(dir_fd, path, 0)) {
std::cerr << "Error[" << errno << "] removing file "
<< path << std::endl;
abort();
}
exit(0);
} else {
/* do whatever */
}
But that is a heck of a lot more work and ugliness for what Windows
gives you practically for free.
>> Interestingly, Windows programs still do the same thing.
>
> Not all of them. Obviously it's not supported on the legacy file
> systems, so some programs that are supposed to work with FAT and/or were
> ported from Linux do something different.
Sadly, this represents the vast majority of Windows software. I've
learned this the hard way. :-(
- --Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGb6udOagjPOywMBARAidjAJ92IvWIZUfhNpsEy76Kw6pUBukkBACg4feR
bKmsBryOuCycK4FLd3+GJ6g=
=Xmoe
-----END PGP SIGNATURE-----
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg