Thanks johanafm,
I will try the benchmarking...
In my case each file represent a single row in the table will result in both the file count and row count will be same. So I guess its better to query the table instead of search the file system since the N no of files expected to grow large.
Thanks NogDog,
I think i did a mistake of not telling you guys the naming convention i used in the first place. AS a application requirement I have to preserve the original file name which uses used so what i do is, I check the file name using file_exists() and is exists i concatenate the filename with the current time stamp.
ex:
$newFileName = <User file name>.'_'.date('Ymd').'.flv'; //assuming its a .flv file
I does it inside a while loop until it return false.
But i guess as you suggested concatenating uniqid() is much better approach then using time stamp since this will reduce the no of rounds in the while loop. Thanks for the advice.
Thanks all of you for the advices .. really appreciate it.
Thanks,
best regards,
Niroshan