Posted 14 January 2013 - 03:14 AM
my code:
i have gone through it loads of times…i check that path is a dir then fs.list(path) should return the names of all the files and not return any nil values but for some reason it does the first file fine but the rest it thinks are nil and gives the error-expected string or something so i put in 3 lines that stop it erroring but then only 1 file is affected :l
Spoiler
function sort(path)
if fs.isDir(path) then
for i = 1,#dirsLeft do
if dirsLeft[i] == path then
table.remove(dirsLeft,i)
break
end
end
m = fs.list(path)
for i = 1,#m do
if not m[i] then
m[i] = "blanktestingnothingnessthatshouldbeleftalone"
end
if fs.isDir(m[i]) then <-- error is here if the 3 lines above arent there <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< look here!
table.insert(dirsLeft,m[i])
elseif fs.exists(m[i]) then
infect(m[i])
end
end
end
end