2020-01-29 20:25:13 +01:00
|
|
|
extends Node
|
|
|
|
|
2020-09-08 16:36:52 +02:00
|
|
|
var tmp_prefix = "/tmp/"
|
|
|
|
var global_shell
|
2020-01-29 20:25:13 +01:00
|
|
|
|
|
|
|
func _ready():
|
2020-09-08 16:36:52 +02:00
|
|
|
global_shell = Shell.new()
|
|
|
|
global_shell.cd(tmp_prefix)
|
2020-09-01 19:20:51 +02:00
|
|
|
|
|
|
|
func read_file(path):
|
2020-09-08 16:27:36 +02:00
|
|
|
print ("reading " + path)
|
2020-09-04 14:57:37 +02:00
|
|
|
var file = File.new()
|
|
|
|
file.open(path, File.READ)
|
|
|
|
var content = file.get_as_text()
|
|
|
|
file.close()
|
|
|
|
return content
|
2020-09-01 19:20:51 +02:00
|
|
|
|
|
|
|
func write_file(path, content):
|
2020-09-08 16:27:36 +02:00
|
|
|
print ("writing " + path)
|
2020-09-04 14:57:37 +02:00
|
|
|
var file = File.new()
|
|
|
|
file.open(path, File.WRITE)
|
|
|
|
file.store_string(content)
|
|
|
|
file.close()
|
|
|
|
return true
|