What does O_DIRECT really mean?

(This answer pertains to Linux – other OSes may have different caveats/semantics) Let’s start with the sub-question: If I open a file with O_DIRECT flag, does it mean that whenever a write(blocking mode) to that file returns, the data is on disk? No (as @michael-foukarakis commented) – if you need a guarantee your data made … Read more

Run a shell command when a file is added

I don’t know how people are uploading content to this folder, but you might want to use something lower-tech than monitoring the directory with inotify. If the protocol is FTP and you have access to your FTP server’s log, I suggest tailing that log to watch for successful uploads. This sort of event-triggered approach will … Read more

Handling multiple SIGCHLD

On Linux, multiple children terminating before you read a SIGCHLD with signalfd() will be compressed into a single SIGCHLD. This means that when you read the SIGCHLD signal, you have to clean up after all children that have terminated: // Do this after you’ve read() a SIGCHLD from the signalfd file descriptor: while (1) { … Read more

Maximum length of command line argument that can be passed to SQL*Plus?

Try with: xargs –show-limits </dev/null Your environment variables take up 2446 bytes POSIX upper limit on argument length (this system): 2092658 POSIX smallest allowable upper limit on argument length (all systems): 4096 Maximum length of command we could actually use: 2090212 Size of command buffer we are actually using: 131072 There is no limit per … Read more