我正在尝试下载并将内容保存到一个XML文件中。我得到的代码是:
local filePath = currentDir().."/file.xml"
local http = require("socket.http")
local xFile = io.open(filePath, "w")
local save = ltn12.sink.file(xFile)
http.request{addr, sink = save }
print("Done!")
它可以运行,但文件仍然是空的。请问能在这里得到帮助吗?