As an opening statement "prepended or appended to a file" ("the file" --> "a file") might be a bit better.