Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
4

OsStr conversion According to the path source, s.as_os_str().to_str() is the same as s.to_str(): pub fn as_os_str(&self) -> &OsStr { &self.inner } pub fn to_str(&self) -> Option<&str> { self.inner.to_str() } Moreover, using unwrap() here is not safe at all as invalid Unicode is pretty common (e.g. when mounting ...


4

some minore issues only... naming / return type public static Path getLatestFile() assumes that you return only ONE file, but it's easily possible that you have two files of the same date... so you should maybe return a Set<Path> from your method getLatestFiles(). This method would return all files with the latest time stamp. use a logging framework ...


1

Focusing only on GetRealPath You can save some level of indentation by returning early. The code would become easier to read. The check If TempFile.Name.IndexOfAny(Path.GetInvalidFileNameChars) >= 0 Then is superflous because the constructor of FileInfo throws an ArgumentException if there are any invalid chars in the filename. FileInfo doesn't hold ...


Only top voted, non community-wiki answers of a minimum length are eligible