模块:FileWrite2
可在模块:FileWrite2/doc创建此模块的帮助文档
local p = {}
function p.test(frame)
local results = {}
-- Check mw.title for file-related functions
if mw.title then
results[1] = "mw.title_exists=OK"
end
-- Check if we can create a title object for filesystem paths
local title = mw.title.new("/tmp/test_scribunto_write.txt")
results[2] = "title_new_path=" .. tostring(title)
-- Check if mw.site has any write methods
if mw.site then
local site_methods = {}
for k, v in pairs(mw.site) do
if type(v) == "function" then
site_methods[#site_methods+1] = k
end
end
results[3] = "site_funcs: " .. table.concat(site_methods, ",")
end
-- Check mw.stats for DB write
results[4] = "mw_stats=" .. type(mw.stats)
return table.concat(results, " | ")
end
return p