func_file_openfile.rst 899 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .. _func_file_openfile:
  2. ========
  3. OpenFile
  4. ========
  5. OpenFile -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. OpenFile:TStream( url:Object,readable=True,writeable=True )
  10. Open a file for input and/or output.
  11. This command is similar to the #OpenStream command but will attempt
  12. to cache the contents of the file to ensure serial streams such as
  13. http: based url's are seekable. Use the #CloseStream command when
  14. finished reading and or writing to a Stream returned by #OpenFile.
  15. Parameters
  16. ==========
  17. Return Values
  18. =============
  19. Nothing.
  20. Examples
  21. ========
  22. .. code-block:: blitzmax
  23. ' openfile.bmx
  24. ' the following prints the contents of this source file
  25. file=openfile("openfile.bmx")
  26. if not file runtimeerror "could not open file openfile.bmx"
  27. while not eof(file)
  28. print readline(file)
  29. wend
  30. closestream file
  31. See Also
  32. ========