Filehandling
Filehandling
FILE HANDLING
Peace of information stored on a permanent
storage device.
Implemented using namespace systems.io
Supports string, character and file manipulation.
Contain properties, methods and events for
creating, copying, moving, and deleting files.
Both strings and numeric data types are
supported, they also allow us to incorporate data
types in files
CLASS OF SYSTEM.IO
FileStream Class - Provides access to standard input
and output files.
Uses members of FileAccess, FileMode and
FileShare Enumerations with the constructors of
this class to create or open a file.
After a file is opened it's FileStream object can be
passed to the Binary Reader, BinaryWriter,
Streamreader and StreamWriter classes to work
with the data in the file.
FileStreamSeek method to move to various
locations in a file which allows to break a file into
records each of the same length.
CLASS OF SYSTEM.IO
StreamReader and StreamWriter Class - The
StreamReader and StreamWriter classes enables
us to read or write a sequential stream of
characters to or from a file.
BinaryReader and BinaryWriter Class - The
BinaryReader and BinaryWriter classes enable us
to read and write binary data, raw 0's and
1's, the form in which data is stored on the
computer.
DIRECTORIES
Collection of files and subfolders.
The Directory class allows us to create and work
with Folders/Directories.
We can create, rename folders and also maintain
drives on the machine.
To create a new directory we should use the
Directory class's CreateDirectory method.