<commit_before>-- load tftpclng.lua
assert(dofile("../examples/tftpclnt.lua"))
assert(dofile("auxiliar.lua"))

-- needs tftp server running on localhost, with root pointing to
-- /home/i/diego/public/html/luasocket/test

host = host or "localhost"
print("downloading")
err = tftp_get(host, 69, "test/index.html")
assert(not err, err)
original = readfile("/home/i/diego/public/html/luasocket/test/index.html")
retrieved = readfile("index.html")
remove("index.html")
assert(original == retrieved, "files differ!")
print("passed")<commit_msg>updated due to test location changes<commit_after>-- load tftpclng.lua
assert(dofile("../examples/tftpclnt.lua"))

-- needs tftp server running on localhost, with root pointing to
-- /home/i/diego/public/html/luasocket/test

function readfile(file)
	local f = openfile("file", "rb")
	local a 
	if f then 
		a = read(f, "*a")
		closefile(f)
	end
	return a
end

host = host or "goya"
print("downloading")
err = tftp_get(host, 69, "index.html", "index.got")
assert(not err, err)
original = readfile("index.index")
retrieved = readfile("index.got")
remove("index.got")
assert(original == retrieved, "files differ!")
print("passed")
{'fraction_non_alphanumeric': 0.16380789022298456, 'fraction_numerical': 0.003430531732418525, 'mean_word_length': 5.207446808510638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4580347', 'n_tokens_mistral': 430, 'n_tokens_neox': 403, 'n_words': 99}