[C# – I/O] Streams and Files

File IO is a basic task, which every developer needs to know. In C#, Streams are used to read/write data from/to a file. Streams are generic representation of data flow. They are not restricted to files. Using streams, you can access data from many different sources (such as memory) in the same manner. Stream related classes are usually located within the “System.IO” namespace.

Continue reading

[C# – I/O] Managing File Systems

Let’s start with files and folders(directories). It is very straight-forward and easy to do basic file management tasks in .NET. Just find the pattern and think of each section of this post as a how-to manual. Most types related I/O are under the “System.IO” namespace.

Usually 2 types are provided for each file system type (file, directory, …).  For example, the “Directory” class provides static methods and the “DirectoryInfo” class provides instance methods.

Continue reading