OK Iām using PHP to delete a file specified in a flash app (Sorry but I canāt show you it :(), the code is extremely simple (Iāve cut out the code thats unrelated):
<?php
echo (unlink ($_POST ['file']));
?>
OK the problem is, once the file is deleted a new file is appears, with a name such as ā.nfs37260B3ā which is deleted within a few seconds. Unfortunately the app refreshes the contents of the folder as soon as the delete if complete, so the new file appears on the list. Is this a temporary file made in order to delete the file :h:
Anyway the problem only seems to occur once tested on the server, on my machine it seems to work fine. Well either that or the new file disappears before the contents of the folder are refreshed
What operating system are you using? I think you are right about this temporary file being using by the operating systemās file-system in the process of deleting the file.
A simple solution that comes to mind is to only search the directory for normal files. (EG: Those that have characters before and after a dot.) A simple regular expression to do this would be: ā.+ā¦+ā
Looks like itās using [w]NFS[/w]. It will create temporary files sporadically to do random stuff, and thereās not really anything you can do to avoid it except not use NFS to mount your files. Googling for ānfs filesā finds a lot of information regarding them, but essentially everything comes to the same conclusion. Just ignore them.
To hide hidden files (Esh is correct in that hidden files are prefixed with a dot), you could also use this regular expression: [font=monospace]^[^.][/font], which unlike Eshās, actually works.
:lol: Ouch, that kind of hurt. But yeah, I didnāt even bother testing that Regex because I suspected that someone with much more Regex knowledge (I read Mastering Regular Expressions about a year ago (Itās the 1996/1997 edition.) but still donāt feel like a Regex Master.) would come in here with a much better solution.
I just took a sec to actually test my regular expression and it does work. :to: