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:
- both files in
/tmp,[destination]directory belongwwwprocess (from behalf of whom operation executed) , have owner's permission writing. - the files end being moved!
- 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
Post a Comment