system.io.fileinfo

What is the best way to rename (move) file system branches in .NET?

I would like to rename files and folders recursively by applying a string replacement operation. E.g. The word "shark" in files and folders should be replaced by the word "orca". C:\Program Files\Shark Tools\Wire Shark\Sharky 10\Shark.exe should be moved to: C:\Program Files\Orca Tools\Wire Orca\Orcay 10\Orca.exe The same operation ...

How to use FileInfo object from Powershell

I am now starting to use PowerShell and after a lot of time using the Unix shells and want to know how to check for the existence of a file or directory. In Powershell why does Exist return false in the following expression? PS H:> ([System.IO.FileInfo]"C:\").Exists False And is there a better way to check if a files is a directory t...

FileInfo object property question - C#?

Does the following System.IO.FileInfo properties map to the following properties in the Windows Explorer application: CreationTime = Date Created LastWriteTime = Date Modified LastAccessTime = Date Accessed ...

Measuring fileinfo.Length objects into kbs

I have the following code: foreach (string p in dirs) { string path = p; string lastAccessTime = File.GetLastAccessTime(path).ToString(); bool DirFile = File.Exists(path); FileInfo fInf = new FileInfo(path); DateTime lastWriteTime = File.GetLastWriteTime(p); ...