My web-service running on
php deliver's files using
X-Accel-Redirect header to the client, if I use
rm /my/folder/*.* how will it handle files currently being accessed/downloaded by clients?
When a process starts reading from a file, it creates a filehandle attached to the inode where the file lives.
When you delete a file, you delete the link from the directory to the inode. That link will be removed immediately, so that no other process will be able to find the file.
However, as long as there is an active filehandle to the inode, the contents will still be accessible from the process using that filehandle. Once all active processes with filehandles to that inode have closed their filehandles, the space where the file has resided will be marked as empty.
You can think of a filename as a kind of symlink.
Of course it's slightly more complex than that, but it's a useful model in this instance.
Incidentally, this is also an answer to the question "why is my disk full even though I deleted this huge log file and there's nothing else taking up the space" - if a process was still reading from or writing to the file, you just made it invisible, you didn't actually clear it.