Improve paths lesson

This commit is contained in:
Bruce Hill 2025-03-25 17:28:48 -04:00
parent e0bde44953
commit 4df28edaf0

View File

@ -7,26 +7,19 @@ func main():
path := (/tmp/test-file.txt) path := (/tmp/test-file.txt)
>> path >> path
= /tmp/test-file.txt = (/tmp/test-file.txt)
path:write("first line") path:write("first")
>> path:read() >> path:read()
= "???" = "???"
path:append(" path:append(",second")
second line
")
>> path:exists() >> path:exists()
= yes = yes
# You can iterate over a file by lines:
>> upper_lines := [line:upper() for line in path:by_line()!]
= [???]
>> path:parent() >> path:parent()
= /??? = (/???)
>> path:extension() >> path:extension()
= "???" = "???"