Lundi 12 mars 2007, vers 20:16:30 (+0100), H. Peter Anvin a écrit:
What about checking for a newline at end of file? Something like:
[...]
# Add a newline at end of file, if needed.
seek(FILE, -1, 2);
if (read(FILE, $last_char, 1) == 1 && $last_char ne "\n") {
seek(FILE, 0, 2);
print FILE "\n";
}
[...]
Regards,
Arnaud Giersch
-