Changeset 111 for trunk/lua/cli.lua


Ignore:
Timestamp:
01/22/2012 09:39:50 PM (16 months ago)
Author:
reyalp
Message:

split filesystem / path utilities into fsutil

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lua/cli.lua

    r98 r111  
    533533                                                end 
    534534                                        end 
    535                                         dst = util.joinpath(dst,util.basename(src)) 
     535                                        dst = fsutil.joinpath(dst,fsutil.basename(src)) 
    536536                                else 
    537537                                        if not args.nolua then 
    538538                                                local st = con:stat(dst) 
    539539                                                if st and st.is_dir then 
    540                                                         dst = util.joinpath(dst,util.basename(src)) 
     540                                                        dst = fsutil.joinpath(dst,fsutil.basename(src)) 
    541541                                                end 
    542542                                        end 
    543543                                end 
    544544                        else 
    545                                 dst = cli:make_camera_path(util.basename(src)) 
     545                                dst = cli:make_camera_path(fsutil.basename(src)) 
    546546                        end 
    547547 
     
    577577                        if not dst then 
    578578                                -- no dest, use final component of source path 
    579                                 dst = util.basename(src) 
     579                                dst = fsutil.basename(src) 
    580580                        elseif string.match(dst,'[\\/]+$') then 
    581581                                -- explicit / treat it as a directory 
    582                                 dst = util.joinpath(dst,util.basename(src)) 
     582                                dst = fsutil.joinpath(dst,fsutil.basename(src)) 
    583583                                -- and check if it is 
    584                                 local dst_dir = util.dirname(dst) 
     584                                local dst_dir = fsutil.dirname(dst) 
    585585                                -- TODO should create it 
    586586                                if lfs.attributes(dst_dir,'mode') ~= 'directory' then 
     
    589589                        elseif lfs.attributes(dst,'mode') == 'directory' then 
    590590                                -- if target is a directory download into it 
    591                                 dst = util.joinpath(dst,util.basename(src)) 
     591                                dst = fsutil.joinpath(dst,fsutil.basename(src)) 
    592592                        end 
    593593 
Note: See TracChangeset for help on using the changeset viewer.