mirror of
https://github.com/CPunch/Cosmo.git
synced 2025-11-10 09:30:06 +00:00
added file:write() & an optional mode param to os.open()
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
|
||||
local err, file = os.open("LICENSE.md")
|
||||
print("made file")
|
||||
if err then
|
||||
print("failed to open file")
|
||||
end
|
||||
|
||||
print(file)
|
||||
print(file:read("a"))
|
||||
|
||||
6
examples/writer.cosmo
Normal file
6
examples/writer.cosmo
Normal file
@@ -0,0 +1,6 @@
|
||||
local err, file = os.open("test.md", "w")
|
||||
if err then
|
||||
print("failed to open file")
|
||||
end
|
||||
|
||||
file:write("hello world")
|
||||
Reference in New Issue
Block a user