How do I tell other processes that a file is marked for deletion?

I am currently writing a C application for an embedded system (limited disk space) On this system, multiple processes access files that I have to delete with my application on certain events (like disk space exhaustion ). But since other processes can still write to these files, the disk space situation does not improve.

Is it possible to actually delete the file and allow write access to other processes?

I have limited access to the behavior of other processes, so it would be nice if there was no interaction between these processes.

+3


source to share


1 answer


Two ideas come to mind to get around the fact that a file is not actually deleted until all references to it are closed:



  • if possible or permitted in your situation, unlink these files and restart other processes.
  • trim / delete these files without deleting them.
+4


source







All Articles