diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-04-18 16:22:00 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-04-18 16:22:00 +0000 |
commit | b0321be1c949491ea8cb2d9e4c075190397d4a87 (patch) | |
tree | 90dcdb60ecba207662d70481cf56b5f9198759ab | |
parent | 2a016e19fe276ec7127c0ae6ef5338e8a170b44e (diff) | |
download | acf-lib-b0321be1c949491ea8cb2d9e4c075190397d4a87.tar.bz2 acf-lib-b0321be1c949491ea8cb2d9e4c075190397d4a87.tar.xz |
Fix fs library references to itself
-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, "/+", "/" ) ) ) |