Checking if the file exists

I am creating portable publication on USB and would like create/read/write using my own text file using scripts. I have gone through the section “How to read data from a text file”. I have following questions.

  1. Is there any way to check if the text file alreay exists ?What is the API for it?
  2. Can i change the path where the .licence and .pref files resides on the USB ?

Try TStringList instead. See (
Using TStringList to read and write text files)

  1. You can try the built-in FileExists function. It is explained here:

  2. No, this feature does not exist yet.

I tried built in FileExists function and it works. Now i want to read the file line by line and i tried built in function ReadLn function. As per the Delphi reference it takes 2 arguments( file handle and string). However if i try that within the script, i get an error. Apperantly it accepts only file handle. So is there a way to read afile line by line ?

Thanks for the link. Will try it out.