# Prior to any opendir() statement issue: system("sync"); # This will flush all buffers to the disk and refresh the disk snapshot # Next issue your opendir statement opendir(...); # Start your processing