ebmDevMag.com home
ebm Developer's Magazine
links

developer's mag
main page

article
part 1
part 2
part 3
part 4
part 5
part 6


6 - Conclusion

The demo program that uses this class does little error checking on I/O - this is deliberate, so you can blow it up easily on the emulator (writing to a read-only file, or reading from a closed file). Functions like IsOpen() and ReadOnly() should be used to check before accessing the file in production code. However, when I moved this code to the eBookMan itself, it actually worked! I shudder to think what my memory looked like after I shrank my file down to zero, and then wrote a string to it. The moral is: add lots of error checking, pay attention to the emulator, and don't assume that because something runs successfully on the ebm, it's coded correctly.

Although this class is by no means the only way to access files, it's useful to hide the details that are easy to forget. At the very least, it can be a springboard to your own custom code. In any case, file I/O is new and different under the ebm, but very straightforward to use once you get the hang of it.

Previous Section


Copyright © 2001-2006 ebmDevMag.com - Legal Notice