SHOW:
|
|
- or go back to the newest paste.
| 1 | local PF = "OS/" -- full path of file. make this file startup file | |
| 2 | local old_fsOpen = _G["fs"]["open"] | |
| 3 | ||
| 4 | _G["fs"]["open"] = function (path, mode) | |
| 5 | mode = string.lower (mode) | |
| 6 | ||
| 7 | -- copy below 3 lines to add new files. | |
| 8 | ||
| 9 | if shell.resolveProgram (path) == shell.resolveProgram (PF..".lock") and (mode == "w" or mode == "wb") then | |
| 10 | return nil | |
| 11 | end | |
| 12 | if shell.resolveProgram (path) == shell.resolveProgram (PF..".oslock") and (mode == "w" or mode == "wb") then | |
| 13 | return nil | |
| 14 | end | |
| 15 | if shell.resolveProgram (path) == shell.resolveProgram (PF..".computer") and (mode == "w" or mode == "wb") then | |
| 16 | return nil | |
| 17 | end | |
| 18 | if shell.resolveProgram (path) == shell.resolveProgram (PF.."run") and (mode == "w" or mode == "wb") then | |
| 19 | return nil | |
| 20 | end | |
| 21 | if shell.resolveProgram (path) == shell.resolveProgram (PF.."createfile") and (mode == "w" or mode == "wb") then | |
| 22 | return nil | |
| 23 | end | |
| 24 | if shell.resolveProgram (path) == shell.resolveProgram (PF.."notepad") and (mode == "w" or mode == "wb") then | |
| 25 | return nil | |
| 26 | end | |
| 27 | if shell.resolveProgram (path) == shell.resolveProgram (PF..".search") and (mode == "w" or mode == "wb") then | |
| 28 | return nil | |
| 29 | end | |
| 30 | if shell.resolveProgram (path) == shell.resolveProgram (PF.."noteread") and (mode == "w" or mode == "wb") then | |
| 31 | return nil | |
| 32 | end | |
| 33 | if shell.resolveProgram (path) == shell.resolveProgram (PF..".password") and (mode == "w" or mode == "wb") then | |
| 34 | return nil | |
| 35 | end | |
| 36 | if shell.resolveProgram (path) == shell.resolveProgram (PF..".osprotect") and (mode == "w" or mode == "wb") then | |
| 37 | return nil | |
| 38 | end | |
| 39 | if shell.resolveProgram (path) == shell.resolveProgram (PF.."editor") and (mode == "w" or mode == "wb") then | |
| 40 | return nil | |
| 41 | end | |
| 42 | if shell.resolveProgram (path) == shell.resolveProgram ("startup") and (mode == "w" or mode == "wb") then
| |
| 43 | return nil | |
| 44 | end | |
| 45 | return old_fsOpen (path, mode) | |
| 46 | end |