summaryrefslogtreecommitdiffstats
path: root/lib/modelfunctions.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-01-16 15:37:53 +0000
committerTed Trask <ttrask01@yahoo.com>2009-01-16 15:37:53 +0000
commit2c2f5c6de04aa287495282b4de9354dfb126bbf4 (patch)
tree23177cce0e9826f81d5ce76a05b3940240be1427 /lib/modelfunctions.lua
parent6b4954fd9d880143a6375ca455624b29047524b4 (diff)
downloadacf-core-2c2f5c6de04aa287495282b4de9354dfb126bbf4.tar.bz2
acf-core-2c2f5c6de04aa287495282b4de9354dfb126bbf4.tar.xz
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
Diffstat (limited to 'lib/modelfunctions.lua')
-rw-r--r--lib/modelfunctions.lua1
1 files changed, 1 insertions, 0 deletions
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