private static bool TryOpen(string filePath, out SafeFileHandle fd) { fd = Interop.Sys.Open(filePath, Interop.Sys.OpenFlags.O_RDONLY, 0); if (fd.IsInvalid) { // Don't throw in this case, as we'll be polling multiple locations looking for the file. fd = null; return false; } return true; }