**中文文档**
        
        遍历path目录下的所有文件, 返回绝对路径。
324682
def yield_all_file_path(dir_abspath):
        
        if os.path.isdir(dir_abspath):
            dir_abspath = os.path.abspath(dir_abspath)
            for current_folder, _, fnamelist in os.walk(dir_abspath):
                for fname in fnamelist:
                    yield os.path.join(current_folder, fname)
        else:
            raise FileNotFoundError(
                "'%s' may not exists or is not a directory!" % dir_abspath)
1214319
public static String dirpart(final String path) {
        int s = path.lastIndexOf(File.separatorChar);
        if (s != -1) {
            return path.substring(0, s);
        } else {
            return null;
        } 
    }
1193383
def path_for(self, *args):
        """"""
        if args and args[0].startswith(os.path.sep):
            return os.path.join(*args)
        return os.path.join(self._root_path or os.getcwd(), *args)
70436
def dump_to_path(self, cnf, filepath, **kwargs):
        
        _not_implemented(self, cnf, filepath, **kwargs)
915690
public List<String> lsFiles(String path) {
		return ls(path, new Filter<LsEntry>() {
			@Override
			public boolean accept(LsEntry t) {
				return false == t.getAttrs().isDir();
			}
		});
	}
145752
function paths(dir) {
	var paths = [];

	try {
		fs.statSync(dir);
	}
	catch (e) {
		return e;
	}

	(function traverse(dir, stack) {
		stack.push(dir);
		fs.readdirSync(stack.join('/')).forEach(function(file) {
			var path = stack.concat([file]).join('/'),
				stat = fs.statSync(path);

			if (file[0] == '.' || file === 'vendor') {
				return;
			} else if (stat.isFile() && /\.js$/.test(file)) {
				paths.push(path);
			} else if (stat.isDirectory()) {
				paths.push(path);
				traverse(file, stack);
			}
		});
		stack.pop();
	})(dir || '.', []);

	return paths;
}
1189161
public void mkDirs(String dir) {
		final String[] dirs = StrUtil.trim(dir).split("[\\\\/]+");

		final String now = pwd();
		if(dirs.length > 0 && StrUtil.isEmpty(dirs[0])) {
			//首位为空，表示以/开头
			this.cd(StrUtil.SLASH);
		}
		for (int i = 0; i < dirs.length; i++) {
			if (StrUtil.isNotEmpty(dirs[i])) {
				if (false == cd(dirs[i])) {
					//目录不存在时创建
					mkdir(dirs[i]);
					cd(dirs[i]);
				}
			}
		}
		// 切换回工作目录
		cd(now);
	}
999975
function getRelativePath (from, to) {
  // 去除相同部分
  var i = 0
  while (from[i] === to[i]) {
    i++
  }
  from = from.substr(i)
  to = to.substr(i)
  // 加上..或.
  var l = from.split(/\/|\\/).length - 1
  var s = ''
  if (l) {
    while (l--) {
      s += '../'
    }
  } else {
    s = './'
  }
  return s + to
}
1146733
public Set<Class<?>> findAndAddClassesInPackageByFile(String packageName, String packagePath,
                                                          final boolean recursive) {
        LOGGER.debug("扫描包{}下、目录{}下的所有class", packageName, packagePath);
        Set<Class<?>> classes = new LinkedHashSet<>();
        // 获取此包的目录 建立一个File
        File dir = new File(packagePath);
        // 如果不存在或者 也不是目录就直接返回
        if (!dir.exists() || !dir.isDirectory()) {
            LOGGER.debug("用户定义包名 " + packageName + " 下没有任何文件");
            return Collections.emptySet();
        }
        // 如果存在 就获取包下的所有文件 包括目录
        File[] dirfiles = dir.listFiles(file -> (recursive && file.isDirectory())
                                                || (file.getName().endsWith("" + "" + ".class")));

        if (dirfiles == null || dirfiles.length == 0) {
            return Collections.emptySet();
        }

        // 循环所有文件
        for (File file : dirfiles) {
            // 如果是目录 则继续扫描
            if (file.isDirectory()) {
                classes.addAll(findAndAddClassesInPackageByFile(packageName + "/" + file.getName(),
                    file.getAbsolutePath(), recursive));
            } else {
                // 如果是java类文件 去掉后面的.class 只留下类名
                String className = file.getName().substring(0, file.getName().length() - 6);
                try {
                    packageName = packageName.replaceAll("/", ".");
                    className = packageName + '.' + className;
                    classes.add(classLoader.loadClass(className));
                } catch (Throwable e) {
                    LOGGER.error("添加用户自定义视图类错误 找不到此类的.class文件", e);
                }
            }
        }
        return classes;
    }
352132
private String normalizePath(String path) {
		// 标准化路径
		path = FileUtil.normalize(path);
		path = StrUtil.removePrefix(path, StrUtil.SLASH);

		Assert.isFalse(FileUtil.isAbsolutePath(path), "Path [{}] must be a relative path !", path);
		return path;
	}
418514
private void scanJavaClassPaths() {
		final String[] javaClassPaths = ClassUtil.getJavaClassPaths();
		for (String classPath : javaClassPaths) {
			// bug修复，由于路径中空格和中文导致的Jar找不到
			classPath = URLUtil.decode(classPath, CharsetUtil.systemCharsetName());

			scanFile(new File(classPath), null);
		}
	}
129258
function ( src, dst ){
      // 读取目录中的所有文件/目录
      fs.readdir( src, function ( err, paths ){
          if( err ){
              throw err;
          }

          paths.forEach(function ( path ){
              var _src = src + '/' + path,
                  _dst = dst + '/' + path,
                  readable, writable;
              fs.stat( _src, function ( err, st ){
                  if( err ){
                      throw err;
                  }
                  // 判断是否为文件
                  if( st.isFile() ){
                      // 创建读取流
                      readable = fs.createReadStream( _src );
                      // 创建写入流
                      writable = fs.createWriteStream( _dst );
                      // 通过管道来传输流
                      readable.pipe( writable );
                  }
                  // 如果是目录则递归调用自身
                  else if( st.isDirectory() ){
                      exists( _src, _dst, copy );
                  }
              });
          });
      });
  }
765189
function copyDir(srcPath, desPath, relative) {
    if(relative == undefined){
        relative = srcPath;
    }

    fs.readdir(srcPath, function (err, files) {
        files.forEach(function (fileName) {
            fs.stat(path.join(srcPath, fileName), function (err, stats) {
                if (err) {
                    console.log('[error] ', err);
                    return;
                }
                if (stats.isFile()) {
                    var relativePath = path.relative(relative, srcPath);
                    var replace = { win32: '..\\', linux: '../' };

                    var srcFile = path.normalize(srcPath + '/' + fileName);
                    var desFile = path.normalize(path.join(desPath,
                        relativePath.replace(replace[os.platform])) + '/' + fileName);
                    //console.log('src file:', srcFile);
                    //console.log('des file:', desFile);
                    createDir(srcFile,desFile);

                } else if (stats.isDirectory()) {
                    //第三个参数用于区分是否是递归开始，并且计算目标路径相对于给定路径的相对位置
                    copyDir(path.join(srcPath,fileName),desPath,relative);
                }
            });
        });
    });
}
1217175
function makeLoggers(path) {
    //创建日志目录，路径不存在
    if(!path) {
        console.error('path can not be null!');
    }

    //创建目录
    try {
        mkdirp.sync(path);
    } catch (err) {
        console.error(err);
        path = false;
    }
    
    //设置日志的参数
    var loggers = {};
    _.forEach(exports.config,function(v,k) {
        pathfile = path?(path+v.file):false;
        loggers[k] = configLogger(pathfile,v.level,v.trans,v.procs);
    });
    return loggers;
}
326531
private static String loadtxt(String path){
		String rules = "";
		try {		
			InputStreamReader  read = new InputStreamReader (new FileInputStream(path),"utf-8");
			BufferedReader bin = new BufferedReader(read);
			String _ruleunit = bin.readLine();
			while (_ruleunit!=null)
			{
				if (!_ruleunit.startsWith("-"))
				{
					if(rules.equals(""))
						rules=rules+"("+_ruleunit+")";
					else
						rules=rules+"|("+_ruleunit+")";
				}	
				_ruleunit=bin.readLine();
			}
		}catch(Exception e){
			System.out.println("正则表达式文件未找到！");
		}
		return rules;
	}
820034
private String read(String path) throws IOException {
        StringBuffer sb = new StringBuffer();
        String tempStr;
        File file = new File(path);
        // 如果文件不存在，读取失败
        if (!file.exists()) throw new FileNotFoundException();
        FileInputStream fis = new FileInputStream(file);
        BufferedReader br = new BufferedReader(new InputStreamReader(fis));
        while ((tempStr = br.readLine()) != null) sb.append(tempStr);
        return sb.toString();
    }
844474
def abspath(*path):
    """"""
    setup_dir = os.path.dirname(os.path.abspath(__file__))
    return os.path.join(setup_dir, *path)