User Tools

Site Tools


doc:lua_make-your-own-scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:lua_make-your-own-scripts [2015/12/06 11:23] admindoc:lua_make-your-own-scripts [2019/04/08 18:43] (current) – [The IO Commands] admin
Line 192: Line 192:
  
  
-^  filename  ^  message  ^  Effect  ^+^  filename  ^  message  ^  Effect  |
 |/unix-path/.. |any message |Open a file Open dialog with preselected path (and file). At success returns the file path, otherwise null | |/unix-path/.. |any message |Open a file Open dialog with preselected path (and file). At success returns the file path, otherwise null |
-|/unix-path/.. |'direct' |Open the given file without Dialog, At success returns the file path, otherwise null \\ actual either complete path are supported, relative paths or filenames only. Filenames and relative paths are relative to the actual script directory |+|/unix-path/.. |'direct' |Open the given file without Dialog, At success returns the file path, otherwise null  \\ actual either complete path are supported, relative paths or filenames only. Filenames and relative paths are relative to the actual script directory |
 |URL like ''HTTP:<nowiki>//</nowiki>''.. |'html' |Reads the URL as input.At  success returns the URL, otherwise null | |URL like ''HTTP:<nowiki>//</nowiki>''.. |'html' |Reads the URL as input.At  success returns the URL, otherwise null |
-|URL like ''HTTP:<nowiki>//</nowiki>''.. |'json' |JSON-RFC call: The parameter ''file_extension'' can be a lua table or a JSON string, in case of a lua table, it's translated into a JSON string and send as POST to the given URL.  |+|URL like ''HTTP:<nowiki>//</nowiki>''.. or ''file:<nowiki>//</nowiki>''..|'json' |JSON-RFC call: The parameter ''file_extension'' can be a lua table or a JSON string, in case of a lua table, it's translated into a JSON string and send as POST to the given URL. In case of a file:<nowiki>//</nowiki>- URL, the local file is read as a JSON file |
  
  
-=== ioRead("*line"===+After opening the file with IOInput(), it can be read with ioRead()
  
 +=== ioRead("%%*%%line") ===
  
-Read one line of the input file ending with either %%\%%r%%\%%n or %%\%%n as string without the EOL. In case of input EOF or read errors the function returns nil. By this the whole file can be read line per line 
  
- +Read one line of the input file ending with either<nowiki> \</nowiki>r<nowiki>\</nowiki>n or<nowiki> \</nowiki>n as string without the EOL. In case of input EOF or read errors the function returns nil. By this the whole file can be read line per line 
-=== ioRead ("*all") ===+=== ioRead ("%%*%%all") ===
  
  
 Read the whole file as string Read the whole file as string
  
-=== ioRead ("*json") ===+ 
 +=== ioRead ("%%*%%json") ===
  
  
Line 216: Line 217:
  
  
-=== ioRead ("*sha256") ===+=== ioRead ("%%*%%sha256") ===
  
  
Line 222: Line 223:
  
  
 +\\
  
 ==== The Buffer Commands ==== ==== The Buffer Commands ====
doc/lua_make-your-own-scripts.txt · Last modified: 2019/04/08 18:43 by admin