C++ system("rm") not deleting properly?
I wrote a program that, once it's done generating some data and putting it in a file, if the file is not a certain number of lines long it is deleted. Due to the nature of this, it generates and removes files a lot before leaving one behind it likes, so the "rm" command is executed a lot. Is it possible that this command may not work properly, resulting in some trace remnants on the hard disk?
The reason I ask is that I have a MacBook with a 120GB hard drive and prior to running this program I had about 40 GB free. I let the program run all morning and just got a warning that my hard disk was almost full! I looked and I had ~200 MB left. I killed the program using 'ctrl-C' and checked to be sure it was deleting the files properly, and it appears that it was. It had generated 85 files that it kept (each ~1/2KB in size), though in its execution it had generated and supposedly deleted countless hundreds or thousands of files. Those files did not show up when I did an 'ls -a', so they don't seem to be hiding.
Does anyone have any thoughts about this issue? I rebooted the computer and now it says I have 1-2 GB left (for some reason it changes every minute or so from, say, 1.45 GB to 1.71 GB to 1.36 GB etc. etc.). Doing a manual check of all directories in /, I can only account for ~75GB of the total 111GB available for use that's not being used by the operating system.