Code: Select all
(let ((in (open "input.txt")))
(read-line in))
Code: Select all
The file #P"C:/ProgramData/Microsoft/Windows/Start Menu/Programs/LispWorks 6.1 Personal/input.txt" does not exist.
Code: Select all
(let ((in (open "input.txt")))
(read-line in))
Code: Select all
The file #P"C:/ProgramData/Microsoft/Windows/Start Menu/Programs/LispWorks 6.1 Personal/input.txt" does not exist.
Code: Select all
(asdf:system-relative-pathname "system" "filename")
Code: Select all
(setf *default-pathname-defaults* #p"/home/me/test/a/")
Code: Select all
(open "input.txt")
Code: Select all
with open('input.txt', 'r') as f:
print(f.readline())
Code: Select all
python foo.py
Code: Select all
python ../a/foo.py
Code: Select all
(setf *default-pathname-defaults* #p"C:/Users/Owner/Documents/Lisp/Read_Demo/")
Code: Select all
(load "reader.lisp")
Code: Select all
? (probe-file "~/ccl-init.lisp")
#P"C:/Users/David Mullen/ccl-init.lisp"
It should be a pathname, actually, rather than a string. However, it's weird that it's empty. How do you access it?jhud wrote:I've tried using *default-pathname-defaults* before, but it always comes up as an empty string because it seems I'm not able to practically "control the directory I start Lisp in."
Launching LispWorks & subsequently opening a file from there isn't the same thing as running a Python script. How do you run Python at home and at school? Using a context menu?jhud wrote:At home, I don't have the option of right-click + Open With for Lisp files, so I just have to open LispWorks from the desktop and open the file from within the program.
Come on, command line is cool. It has nothing to do with your priviledges.jhud wrote: I don't have admin privileges at school, of course, so command prompt isn't really an option.
Yes, in the same way as with Python. Right-clicking a file is an example of such an action. Running something in a terminal with a given working directory is another option.jhud wrote:It seems like no matter what you do, some action has to be taken on the user's end which explicitly defines the directory you're working with.