for example...
Code: Select all
newLISP v.10.2.1 on Win32 IPv4 UTF-8, execute 'newlisp -h' for more info.
> (print (get-url "http://gist.github.com/362201.txt"))
;; ...
(context 'MAIN)
> (context 'Foo)
Foo> (load "http://gist.github.com/362201.txt")
> (println "Context: " (context))
Context: MAIN ; context changed!
>
> (reset true)
> (write-file "/tmp/test.lsp" (get-url "http://gist.github.com/362201.txt"))
> (context 'Foo)
Foo> (load "/tmp/test.lsp")
Foo> (println "Context: " (context))
Context: Foo ; restore context
Foo>
## 2. (read-file "file:///C:/...") => "No such file or directory"
Code: Select all
> (read-file "file:///C:/Program Files/newlisp/COPYING")
nil
> (sys-error)
(2 "No such file or directory")
> (read-file "file://C:/Program Files/newlisp/COPYING")
[text]
Copyright information...
[/text]
Or for a local file, the hostname is omitted, but the slash is not (Note the third slash):
file:///c:/path/to/the%20file.txt