Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local EU = require("ExtraUtilits")
- if EU.version < 1.0 then error("Invalid version of ExtraUtilits library. Install version 1.0 or more to use it.") end
- local fs = require("filesystem")
- local shell = require("shell")
- local gpu = require("component").gpu
- local unicode = require("unicode")
- path = shell.resolve("")
- s = false
- repeat
- lpath = path .. "/" .. EU.ReadyUtilits.WriteFieldUI(60, 23, "Enter folder name")
- local function foo()
- if fs.exists(lpath) then
- local text = "Folder with name '" .. lpath .. "' is already exists."
- gpu.setBackground(0xff0000)
- gpu.setForeground(0xffffff)
- gpu.fill(80 - unicode.wlen(text) / 2, 23, unicode.wlen(text) + 2, 3, " ")
- gpu.set(80 - unicode.wlen(text) / 2 + 1, 24, text)
- os.sleep(2)
- else
- s = true
- end
- end
- EU.screenBackup(foo)
- until s
- path = lpath
- local result, reason = fs.makeDirectory(path)
- if not result then print(reason) end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement