dreamwest Posted May 21, 2009 Share Posted May 21, 2009 Im trying to delete files with 0 size, im using unlink function but it doesnt work, do the files need to have a size greater than 0 to unlink? $fileName = "Video.mpg"; if (filesize($fileName) < 0){ unlink($fileName); echo $fileName." too small - deleted<br>"; } The echo part is printing out but the unlink doesnt do anything Quote Link to comment https://forums.phpfreaks.com/topic/159046-solved-unlink/ Share on other sites More sharing options...
MadTechie Posted May 21, 2009 Share Posted May 21, 2009 Check file permissions and make sure your not trying to delete a folder Quote Link to comment https://forums.phpfreaks.com/topic/159046-solved-unlink/#findComment-838727 Share on other sites More sharing options...
waynew Posted May 21, 2009 Share Posted May 21, 2009 $fileName = "Video.mpg"; if (filesize($fileName) < 0){ unlink($fileName); echo $fileName." too small - deleted<br>"; } Shouldn't it be: if (filesize($fileName) == 0){ ??? Quote Link to comment https://forums.phpfreaks.com/topic/159046-solved-unlink/#findComment-838745 Share on other sites More sharing options...
dreamwest Posted May 21, 2009 Author Share Posted May 21, 2009 it was strreplace interfering with the filename.....dammit Quote Link to comment https://forums.phpfreaks.com/topic/159046-solved-unlink/#findComment-838759 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.