PDA

View Full Version : Search file by size and name


RapD
11-07-2005, 12:38 PM
is it possible to searh a file by the name and the size?
if he found the name and the size not match, he continue searching until he find the same name and the same size.

TJ_Tigger
11-07-2005, 12:52 PM
File.Find has a callback function (FileFoundCallbackFunction) you can use to test the size of the file and then tell the action whether or not to continue.


function CheckFileSize(FoundPath)
if File.GetSize(FoundPath) == 123456 then
return false
else
return true
end
end

RapD
11-07-2005, 01:13 PM
Can you give me a small example? i'm little difficult in this.

TJ_Tigger
11-07-2005, 02:19 PM
Use the File.Find action and the help file. I provided a small excerpt of the code above that could potentially be used to find a file based on the file size. Play with the code, give it a shot, if it doesn't work, post what you tried here and we can help figure out why it may not have worked.

Tigg