if FAT_ADDED > 0 then l[-1] = l[-1][0:FAT_ADDED * -1]
//print l
l = self.Utils.divide(l.join(""), CELL_SIZE)
for i in l.indexes
l[i] = self.Utils.to_int(l[i])
if l[i] < 256 then l[i] = char(l[i])
end for
return l
end function
//This implementation deviates from RFC 7159 - The JavaScript Object Notation (JSON) Data Interchange Format <https://tools.ietf.org/html/rfc7159> in the following ways:
//Section 6 (Numbers):
// Leading zeros are allowed
// Infinity, -Infinity, NaN are considered valid numbers
//Section 7 (Strings):
// Escaping characters is not implemented
// Literal double quote is represented as "" in a string
root_folder_name = user_input("(optional, you can press enter to skip and use the root folder name provided in the import string)\nroot folder name: \n")
export_string = user_input("export string:
")
export_string = user_input("export string:
").replace(char(10), "")
table = json.to_object(export_string)
file_table = {}
for value in table.values
key = table.indexOf(value)
file_name = value["name"].replace(" ", "_")
if value["parent"] == "" then
parent_folder = root_folder
if root_folder_name != "" then file_name = root_folder_name
file_path = parent_folder.path + "/" + file_name
if computer.File(file_path) then computer.File(file_path).delete //clear