Is the sendfile system call still the fastest way to transfer data locally on Linux systems? For communicating between processes running locally on system. Or, for example, a server running locally on an android device. Unix domain sockets typically beat TCP connections for most large file transfers. But is there anything faster? And what about transfers over the public net from machine to machine? I usually just use…
In Unix Everything Is a File
11–20 of 57 posts
Re: In Unix Everything Is a File
#12Which was the last Unix release/flavor where you could still read(2) a directory? All manpages that I've found say that you get EISDIR if you try it.
FreeBSD’s man page says (https://www.freebsd.org/cgi/man.cgi?sektion=2&query=read):
[EISDIR] The file descriptor is associated with a directory
residing on a file system that does not allow
regular read operations on directories (e.g. NFS)
NetBSD says something similar, adding ”The readdir() function should be used instead.”I also am not convinced that, for example, the Linux man page (http://man7.org/linux/man-pages/man2/read.2.html) guarantees you get EISDIR when reading from a directory. It says that if you get EISDIR, fd refers to a directory, but isn’t explicit about the converse.
Re: In Unix Everything Is a File
#13"Everything is a file" is a nice idea not taken far enough. The execution is full of frustrating omissions and holes at the edges, e.g.: - unless you are using Plan 9 or gpm, reading mouse events is almost certainly going to be a lot more involved than opening /dev/mouse - you can't portably use select() to wait on pthread conditions - lots of useful things (like POSIX shared memory objects) are file descriptors, but…
I never had such appreciation for Plan 9, as I consider Inferno the best design of what they were trying to achieve.
The only caveat was that they never came around to add an ahead of time compilation support to DisVM.
Re: In Unix Everything Is a File
#14Is the sendfile system call still the fastest way to transfer data locally on Linux systems? For communicating between processes running locally on system. Or, for example, a server running locally on an android device. Unix domain sockets typically beat TCP connections for most large file transfers. But is there anything faster? And what about transfers over the public net from machine to machine? I usually just use…
Re: In Unix Everything Is a File
#15Which was the last Unix release/flavor where you could still read(2) a directory? All manpages that I've found say that you get EISDIR if you try it.
Re: In Unix Everything Is a File
#16I think the author might have confused Plan9 and UNIX.
Re: In Unix Everything Is a File
#17Which was the last Unix release/flavor where you could still read(2) a directory? All manpages that I've found say that you get EISDIR if you try it.
That depends on the file system (and, possibly, the OS, but I think the OS should just forward the call to the relevant driver and return its result) FreeBSD’s man page says ( https://www.freebsd.org/cgi/man.cgi?sektion=2&query=read ): [EISDIR] The file descriptor is associated with a directory residing on a file system that does not allow regular read operations on directories (e.g. NFS) NetBSD says something simila…
https://github.com/torvalds/linux/blob/2a56bb596b2c1fb612f99...
https://github.com/torvalds/linux/search?p=1&q=generic_read_...
Re: In Unix Everything Is a File
#18Is the sendfile system call still the fastest way to transfer data locally on Linux systems? For communicating between processes running locally on system. Or, for example, a server running locally on an android device. Unix domain sockets typically beat TCP connections for most large file transfers. But is there anything faster? And what about transfers over the public net from machine to machine? I usually just use…
Consider trying rsync instead of scp - I've found it to be faster for multiple small files.
Re: In Unix Everything Is a File
#19But hey, that's stupid. Let's not do that...!
Re: In Unix Everything Is a File
#20Wordpress strikes again. Page is from 2014. Archive link: https://web.archive.org/web/20091119184152/https://ph7spot.c... Edit: archive of 6 years ago with some styling: http://archive.is/B9He (The page actually loaded for me on the second try, and the design looks a lot more modern now.)