Changeset 115 for trunk/lua/fsutil.lua


Ignore:
Timestamp:
01/23/2012 05:47:33 AM (16 months ago)
Author:
reyalp
Message:

move make_camera_path to fsutil

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lua/fsutil.lua

    r113 r115  
    222222        end 
    223223end 
     224 
     225function fsutil.make_camera_path(path) 
     226        if not path then 
     227                return 'A/' 
     228        end 
     229        -- fix slashes 
     230        path = string.gsub(path,'\\','/') 
     231        local pfx = string.sub(path,1,2) 
     232        if pfx == 'A/' then 
     233                return path 
     234        end 
     235        if pfx == 'a/' then 
     236                return 'A' .. string.sub(path,2,-1) 
     237        end 
     238        return 'A/' .. path 
     239end 
     240 
    224241--[[ 
    225242make multiple subdirectories 
Note: See TracChangeset for help on using the changeset viewer.