From 0b933c7c8b5daf0fd62d9f9dfef973b8383250f1 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 24 Jul 2008 20:43:15 +0000 Subject: Another rewrite of validator to remove dnsfiles and add a generic way for other controllers to save user-based settings. Also added fs.create_file function. git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1317 ab2d0c66-481e-0410-8bed-d214d4d58bed --- lib/fs.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/fs.lua') diff --git a/lib/fs.lua b/lib/fs.lua index 7b60591..31e8f13 100644 --- a/lib/fs.lua +++ b/lib/fs.lua @@ -23,7 +23,14 @@ function is_link ( pathstr ) end - +-- Creates a blank file +function create_file ( path ) + local cmd = "touch "..path + local f = io.popen(cmd) + f:close() + return is_file(path) +end + -- Returns the contents of a file as a string function read_file ( path ) local file = io.open(path) -- cgit v1.2.3