in reply to Unix rename behaviour
At the same time I launch in another terminal:$ echo "hello" > toto $ cat toto hello $ perl -e 'open F, "<toto"; sleep 30; print <F>'
The output in the first shell is "goodbye". If I change the second one liner to rename the file :$ perl -e 'open F, ">toto"; print F 'goodbye'; close F; sleep 30'
The output remains goodbye. However, if I change the second one-liner to:perl -e 'open F, ">toto"; system ("mv toto tata"); print F 'goodbye'; +close F; sleep 30'
So to close the file last, then the first oneliner reads nothing at all.perl -e 'open F, ">toto"; system ("mv toto tata"); print F 'goodbye'; +sleep 30'
|
|---|