Posted 15 May 2016 - 07:39 AM
Hi, I've been trying to make a custom fs.open() to upload and download files automatically,but when I try to use it,it errors:
CCEmuRedux:
Mimic:
(Pastebin)
Does anybody know how to fix this?
CCEmuRedux:
11: vm error: java.lang.ArrayIndexOutOfBoundsException: 256
Mimic:
11: stack overflow
Spoiler
-- indenting doesn't work on the post editor :/
oldfs = fs
newfs = {}
function newfs.open(file,method)
if method == 'r' then
download(file)
end
oldHandle = oldfs.open(file,method)
newHandle = oldHandle
if method == 'w' or method == 'a' then
function newHandle.close()
oldHandle.close()
upload(file)
end
end
return newHandle
end
local h = newfs.open('test','w')
h.write('test')
h.close()
Does anybody know how to fix this?
Edited on 15 May 2016 - 07:22 AM