PHP rename() from /tmp throws warning, although actually works -


moving files /tmp dir, i'm getting warning:

rename(/tmp/[somefile], [destination] ): operation not permitted in [...]

there 3 strange things it:

  1. both files in /tmp , [destination] directory belong www process (from behalf of whom operation executed) , have owner's permission writing.
  2. the files end being moved!
  3. moving files across other directories, performed in same way, works fine.

in other words, works throws warning not. pretty weird me.

what may reason of such behaviour?

rename supposed atomic operation; i.e., there's never time when both old , new file names exist or neither exists. /tmp separate file system on linux servers. guess you're getting warning because move isn't atomic (because it's between 2 different file systems) though works. closer copy followed delete instead of move on 1 file system.

example of similar issue: https://ubuntuforums.org/showthread.php?t=1272466


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -