Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This is part of a Computercraft Programming Teaching Program
- tSides = {"left","right","bottom","top","front","back"}
- for i = 1, #tSides do
- monitor = peripheral.wrap(tSides[i])
- if monitor then
- side = tSides[i]
- break
- end
- end
- --Prevents program termination
- os.pullEvent = os.pullEventRaw
- term.redirect(peripheral.wrap(side))
- -- Resets Screen
- function reset()
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- end
- reset()
- print("Section 9.1 - File System Cont. \n ")
- print(" ")
- print("file1.readLine() - Reads the next line in the file (only works while in read mode)")
- print("file1.readAll() - Reads all the data in the file (only works while in read mode)")
- print("file1.flush() - Flushes the data to the file while keeping the handle open afterwards")
- print("This is mainly used for logging purposes")
- print("file1.close() - Closes the file handle")
- print("fs.move(\"file\", \"docs/file2\") - Moves the file \"file\" to the directory \"docs\" with the file name of \"file2\"")
- print("fs.copy(\"file\", \"docs/file2\") - Same as fs.move(), except it copies the program to the new location instead")
- print("fs.delete(\"file\") - Deletes the file \"file\"")
- term.restore()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement