static string toPathStr(bool isAbs, List path, bool isDir)
{
StringBuilder buf = new StringBuilder();
if (isAbs) buf.Append('/');
for (int i=0; i<path.sz(); ++i)
{
if (i > 0) buf.Append('/');
buf.Append(path.get(i));
}
if (isDir && !(buf.Length > 0 && buf[buf.Length-1] == '/'))
buf.Append('/');
return buf.ToString();
}