Re: Deleting file contents synchronization c++
There is no lock in Linux but the behavior isn't much better here. The delete will return and indicate success, the file will no longer be visible as a name on the file system, but the inode will still exist and the other program will still be merrily writing in it... So, you erase a 4GB log , but don't recover the disk space... The file will only be erased when that other program closes it (or when it terminates). Murphys says this usually happens while you call colleagues for help, so you look stupid and have to pay for the next round of beverages.
Originally Posted by dwhitney67
Warning: unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.