Diff

util/datamanager.lua @ 7001:2743759ca1b5

util.datamanager: Return extra location info
author Kim Alvefur <zash@zash.se>
date Fri, 11 Dec 2015 20:31:19 +0100
parent 7000:2b57f77985a3
child 7002:9ab0d5e69c41
line wrap: on
line diff
--- a/util/datamanager.lua	Fri Dec 11 20:30:39 2015 +0100
+++ b/util/datamanager.lua	Fri Dec 11 20:31:19 2015 +0100
@@ -220,7 +220,7 @@
 		-- File did probably not exist, let's create it
 		f, msg = io_open(filename, "w");
 		if not f then
-			return nil, msg;
+			return nil, msg, "open";
 		end
 	end
 
@@ -239,7 +239,7 @@
 	ok, msg = f:write(data);
 	if not ok then
 		f:close();
-		return ok, msg;
+		return ok, msg, "write";
 	end
 
 	ok, msg = f:close();
@@ -247,7 +247,7 @@
 		return ok, msg;
 	end
 
-	return true;
+	return true, pos;
 end
 
 local function list_append(username, host, datastore, data)