From 2c2f5c6de04aa287495282b4de9354dfb126bbf4 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 16 Jan 2009 15:37:53 +0000 Subject: Modified modelfunction write_file_with_audit to create directory if missing. git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1681 ab2d0c66-481e-0410-8bed-d214d4d58bed --- lib/modelfunctions.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/modelfunctions.lua b/lib/modelfunctions.lua index e0d2885..076d1bb 100644 --- a/lib/modelfunctions.lua +++ b/lib/modelfunctions.lua @@ -196,6 +196,7 @@ function write_file_with_audit (self, path, str) pre(self, path, tmpfile) end + if fs.dirname(path) and not posix.stat(fs.dirname(path)) then fs.create_directory(fs.dirname(path)) end os.rename (tmpfile, path) if (type(post) == "string" and #post) then -- cgit v1.2.3