I'm using the following function to mimic the tail command in unix. It needs to open a file and read from it. As you can see I'm only opening it in readonly mode but I still get the error that I cannot access the file. Can anyone suggest an alternate method to accomplish this task?
function tform1.Tail(FileName:string; Position:Integer):string;
S := TFileStream.Create(FileName, fmOpenRead ,fmShareDenyNone);
L := S.Size-Position;