As subject. Running the attached testcase displays:
First line of $data-n.txt is: Line 1 of file $data-n.txt
Second line of $data-n.txt is: Line 2 of file $data-n.txt
First line of $data-r.txt is:
Second line of $data-r.txt is: Line 1 of file $data-r.txt
where the two files are identical except the second has the read-only attribute set. This on Windows (both XP and 7).