Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = { ... }
- if #args ~= 2 then
- error('Syntax: ls <source> <target>')
- end
- local source = shell.resolve(args[1])
- local target = shell.resolve(args[2])
- if not fs.isDir(source) then
- error('Source must be a directory')
- end
- if fs.isDir(target) then
- target = fs.combine(target, fs.getName(source))
- end
- if fs.exists(target) then
- error('Target already exists')
- end
- fs.link(source, target)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement