12345678910111213141516171819202122232425262728293031 |
- --[[ vim: sw=4 ts=4
- эта программа выводит все ссылки из файла links.txt, соответствующие
- которым файлы не скачаны
- применение:
- $ ./ldiff links.txt | wget2 -ci-
- ]]--
- local args = {...}
- if not args[1] then
- print("specify filename")
- os.exit(1)
- end
- local file = io.open(args[1], "r")
- if not file then
- print("file does not exists")
- os.exit(2)
- end
- for line in file:lines("l") do
- local pos = #line - line:reverse():find('/') + 2
- local target = io.open(line:sub(pos), 'r')
- if not target then
- print(line)
- end
- end
- file:close()
|