On Sun, Aug 12, 2012 at 7:44 AM, Richard D. Moores <rdmoo...@gmail.com> wrote:
>
> I just discovered
> os.path.getsize('factors.txt')
> and that factors.txt has a size of 2 bytes when "empty".
> (I changed the file extension to .txt so I could delete the contents.)

No, an empty file has no data; the size is 0. You must have saved a
text file in Windows that added a byte order mark (BOM). Windows adds
a BOM for UTF-8 and UTF-16 ('Unicode') files. It sounds silly to have
a BOM for UTF-8, which can't have a little endian or big endian byte
order, but it's there to distinguish UTF-8 from 8-bit ANSI (e.g.
Windows 1252).
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to