PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
i've read up on deleting files, and it seems that unlink($filename), where $filename is just a string containing the file url, is what i must use.
but i've also read that unlink merely unlinks the file from its directory, thus it isn't actually removed, but only forgotten about.
now if my hosting provider charges me per megabyte of storage used, and i unlink a 50mb file, is it deleted or merely just forgotten about?
when i do a directory listing (using glob() for example) the file is no longer there, but i want to be sure that it's not taking up space (and hence costing me money) either.
can someone please confirm this or perhaps explain how files are to be properly removed in php?
Files are never DELETED per se on a system anyway... when you delete a file in windows, the only thing you are "erasing" is its address... the only way to really "erase" anything is to write over it. (with either real data or just all zeros)
ok so is it safe to say that if my file is unlinked, it no longer takes up space? i am referring to checking free space on a hard drive. i understand that it isn't physically removed, and is thus still occupying space. but as far as my os goes, that space is now free.