XLS files are using the
Excel Binary File Format[
^]. So you can't read and write them using C text I/O functions.
You may use an office product available for your Unix that is able to read and write those files (e.g. OpenOffice, LibreOffice).
If you need to read and write files programmatically it would be better to choose a simple file format that is also supported by Excel like CSV or HTML.