diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-04-18 16:22:00 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-12-04 15:06:39 +0000 |
commit | 443a40b769d9dd487ab262aebab71cc8ac3b0686 (patch) | |
tree | 8adde03ecc308c3858af9e75944f8df0058bb5af | |
parent | dd30bef02c2b245e000e5a5182b17b3d80bd0de4 (diff) | |
download | acf-lib-443a40b769d9dd487ab262aebab71cc8ac3b0686.tar.bz2 acf-lib-443a40b769d9dd487ab262aebab71cc8ac3b0686.tar.xz |
Fix fs library references to itself
(cherry picked from commit b0321be1c949491ea8cb2d9e4c075190397d4a87)
-rw-r--r-- | fs.lua | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -36,11 +36,11 @@ end -- Deletes a directory along with its contents function remove_directory ( path ) - if fs.is_dir(path) then + if is_dir(path) then for d in posix.files(path) do if (d == ".") or (d == "..") then -- ignore - elseif fs.is_dir(path .. "/" .. d) then + elseif is_dir(path .. "/" .. d) then remove_directory(path .. "/" ..d) else os.remove(path .. "/" ..d) @@ -165,7 +165,7 @@ function write_line_file ( path, str ) if ( file) then local c = file:read("*a") or "" file:close() - fs.write_file(path, c .. (str or "")) + write_file(path, c .. (str or "")) end end @@ -176,20 +176,20 @@ function find_files_as_array ( what, where, follow, t ) t = t or {} local link - if follow and fs.is_link(where) then + if follow and is_link(where) then link = posix.readlink(where) if not string.find(link, "^/") then link = posix.dirname(where).."/"..link end end - if fs.is_dir(where) or (link and fs.is_dir(link)) then + if is_dir(where) or (link and is_dir(link)) then for d in posix.files ( where ) do if (d == ".") or ( d == "..") then -- do nothing - elseif fs.is_dir ( where .. "/" .. d ) then + elseif is_dir ( where .. "/" .. d ) then find_files_as_array (what, where .. "/" .. d, follow, t ) - elseif follow and fs.is_link ( where .. "/" .. d ) then + elseif follow and is_link ( where .. "/" .. d ) then find_files_as_array (what, where .. "/" .. d, follow, t ) elseif (string.match (d, "^" .. what .. "$" )) then table.insert (t, ( string.gsub ( where .. "/" .. d, "/+", "/" ) ) ) |