If you have heard of Delphi, you might have either been told (or you have the understanding) that its nothing more than pascal. Its unfortunate that so many people have this understanding.
To read from and write to a file the best method in Delphi would probably be the TFilestream component. I will go through the basics of TFilestream. This tutorial assumes some basic knowledge in Delphi or Pascal.