do{ $create = -C "test1.jpg"; $modify = -M "test1.jpg"; }until ($create == $modify and $create > 0); # Then process file or whatever.....