function [index]=find_file_at_size_kB(size_kB,dir_struct)

min_kB=1E10;
for iii=1:length(dir_struct),
    curr_diff_kB=abs(dir_struct(iii).bytes-1024*size_kB);
    if curr_diff_kB<min_kB
        index=iii;
        min_kB=curr_diff_kB;
    end
end