I am currently using the code below to get the oldest file in a given path. Recently a folder was created in that path that is quickly become the oldest "file". How can I modify the linq to filter directories and only report on files?
var fileInfo = new DirectoryInfo(path).GetFileSystemInfos();
var oldestFile = fileInfo.OrderBy(fi => fi.CreationTime).FirstOrDefault();