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 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 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){ ??? 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 Link to comment https://forums.phpfreaks.com/topic/159046-solved-unlink/#findComment-838759 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.