Jump to content
Sign in to follow this  
dinoking

Help about code Delete

Recommended Posts

dinoking

How do you write code "Delete files by size" ? I want delele all files by size EX: delete file > 100kb

Thanks

Edited by dinoking

Share this post


Link to post
Share on other sites
amokoura

Read manual for file functions

Share this post


Link to post
Share on other sites
FreeRider

Hi Dinoking,

Amokoura is right.... read help file before asking such question... however here is the way to do it :

First you have to list all the files of the folder (Use _FileSearch() or new _FileListToArray() from the forum)

Once you have your list into an array you must loop and test each item of the array looking for it size

For $i = 1 to $Mylist[0]
$size = FileGetSize("$FullPathToFile"); Size is in bytes
If $size > 102400 (equiv to 100 Kb) Then FileDetele("$FullPathToFile")
Next

Hope this will help you...

Bye


FreeRiderHonour & Fidelity

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×