Marlingaming

Advanced File System API

Apr 6th, 2022 (edited)
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.13 KB | None | 0 0
  1. function CreateShortcut(path,name,image)
  2.  
  3. local file = fs.open(fs.combine("os/Desktop_Shortcuts",name..".lnk"),"w")
  4. file.writeLine(path)
  5. file.writeLine(name)
  6. file.writeLine(image)
  7. file.close()
  8. end
  9.  
  10. function LoadVideo(path,x,y)
  11. shell.run("os/System/Programs/VideoPlayer.lua",x,y+1)
  12. end
  13.  
  14. function getPath(fileName)
  15. local Path = shell.resolve(fileName)
  16. return Path
  17. end
  18.  
  19. function osPaths()
  20. local file = fs.open("os/Directorys.txt","r")
  21. print("=====System=Operation=Files=====")
  22. print(file.readLine())--boot
  23. print(file.readLine())--settings
  24. print(file.readLine())--API doc
  25. print(file.readLine())--API Folder
  26. print(file.readLine())--Desktop shortcut folder
  27. print("=boot=files=")
  28. local list = fs.list("boot")
  29. for i = 1, #list do
  30.     print("_"..list[i])
  31. end
  32. file.close()
  33. end
  34.  
  35. function systemInfo()
  36. print("====System=Info====")
  37. local content
  38. local file = fs.open("os/systemCertificate.txt","r")
  39. print("==OS=Info==")
  40. print("version: "..file.readLine())
  41. print("device id: "..file.readLine())
  42. print("date of installation: "..file.readLine())
  43. print("package: "..file.readLine())
  44. print("========================")
  45. file.close()
  46. end
Add Comment
Please, Sign In to add comment