def partition_path path, web_path = false
if (result = web_path ? @_partition_path_web[path] : @_partition_path_sys[path])
return result
end
posix_path = posixfy path
root = if web_path
if is_web_root? posix_path
SLASH
elsif posix_path.start_with? DOT_SLASH
DOT_SLASH
else
nil
end
else
if is_root? posix_path
if is_unc? posix_path
DOUBLE_SLASH
elsif posix_path.start_with? SLASH
SLASH
else
posix_path[0..(posix_path.index SLASH)]
end
elsif posix_path.start_with? DOT_SLASH
DOT_SLASH
else
nil
end
end
path_segments = posix_path.split SLASH
if root == DOUBLE_SLASH
path_segments = path_segments[2..-1]
elsif root
path_segments.shift
end
path_segments.delete DOT
(web_path ? @_partition_path_web : @_partition_path_sys)[path] = [path_segments, root, posix_path]
end