Get a listing of files given path 'src'

This function is admittedly very inefficient right now.  We'll
make it better later.
176143
FileStatus[] getListing(String src) {
    String srcs = normalizePath(src);
    byte[][] components = INodeDirectory.getPathComponents(srcs);
    readLock();
    try {
      INode targetNode = rootDir.getNode(components);
      if (targetNode == null)
        return null;
      if (!targetNode.isDirectory()) {
        return new FileStatus[]{createFileStatus(
        		src, targetNode)};
      }
      List<INode> contents = ((INodeDirectory)targetNode).getChildren();
      if(! srcs.endsWith(Path.SEPARATOR))
    	  srcs += Path.SEPARATOR;
      FileStatus listing[] = new FileStatus[contents.size()];
      int i = 0;
      for (INode cur : contents) {
        listing[i] = createFileStatus(srcs+cur.getLocalName(), cur);
        i++;
      }
      return listing;
    } finally {
      readUnlock();
    }
  }
378035
public static List<File> listFiles(File srcPath) throws IOException
   {
      List<File> result = new ArrayList<File>();

      if (!srcPath.isDirectory())
      {
         throw new IOException(srcPath.getAbsolutePath() + " is a directory");
      }

      for (File subFile : srcPath.listFiles())
      {
         result.add(subFile);
         if (subFile.isDirectory())
         {
            result.addAll(listFiles(subFile));
         }
      }

      return result;
   }
591706
function files(path, ...matchers) {
	if ( matchers.length ) {
		return listFiles(path.replace(/\\/g, '/'), matchers);
	}

	let rs = [];
	if( isDirectoryExists(path) ) {
		let ls = fs.readdirSync(path);
		ls.forEach((file, index) => rs.push(path + "/" + file));
	}
	return rs;
}
1073351
def slices(src_path):
  '''  '''
  pages = list_slices(src_path)
  slices = []
  for page in pages:
    slices.extend(page.slices)
  return slices
216811
def file_list(path, ext = 'scss', remover = '')
      # Necessary so that directories aren't counted
      collect_path = path.include?("*") ? path : "#{path}/**/*.#{ext}"
      # Remove first slash from path if present. probably a better way to do this.
      Dir[collect_path].collect { |file| file.gsub(remover, '').gsub(/^\/app\//, 'app/') if File.file?(file) }
    end
444384
def files(self):
        
        # If no files but a recursion option ==> use the current directory
        if not self.args.files and self.recursive:
            return ['.']
        else:
            return self.args.files
939893
def listdir(self, path='.'):
        
        self._connect()

        if self.sftp:
            contents = self._sftp_listdir(path)
        else:
            contents = self._ftp_listdir(path)

        self._close()

        return contents
1158252
def find_py_files(srctree, ignore=None):
        

        if not os.path.isdir(srctree):
            yield os.path.split(srctree)
        for srcpath, _, fnames in os.walk(srctree):
            # Avoid infinite recursion for silly users
            if ignore is not None and ignore in srcpath:
                continue
            for fname in (x for x in fnames if x.endswith('.py')):
                yield srcpath, fname
480611
function listDir (path, originalPath) {
  if (!originalPath) {
    originalPath = path + separator;
  }

  // promises for sub listDir calls
  var dirs = [];

  return Promise.resolve(fs.readdir(path))
    // include only files
    .filter(function (item) {
      var absolutePath = join(path, item);

      return fs.stat(absolutePath).then(function (stat) {
        var isDirectory = stat.isDirectory();

        // if directory, read it
        if (isDirectory) {
          var list = listDir(absolutePath, originalPath);

          dirs.push(list);
        }

        return !isDirectory;
      });
    })
    // return relative paths
    .map(function (file) {
      var absolutePath = join(path, file);
      var relativePath = absolutePath.replace(originalPath, '');

      return relativePath;
    })
    // add files from sub-directories
    .then(function (files) {
      // wait for all listDir() to complete
      // and merge their results
      return Promise
        .all(dirs)
        .then(function () {
          dirs.forEach(function (promise) {
            var subFiles = promise.value();

            files = files.concat(subFiles);
          });

          return files;
        });
    });
}
988549
async def list_files(self, path: Union[str, Path] = '.'):
        '''
        
        '''
        params = {}
        if self.owner_access_key:
            params['owner_access_key'] = self.owner_access_key
        rqst = Request(self.session,
                       'GET', '/kernel/{}/files'.format(self.kernel_id),
                       params=params)
        rqst.set_json({
            'path': path,
        })
        async with rqst.fetch() as resp:
            return await resp.json()
1167320
def list_files(directory):
    
    return [f for f in pathlib.Path(directory).iterdir() if f.is_file() and not f.name.startswith('.')]
216369
def get_file_list(self):
        
        if os.path.isdir(self.root_path):
            return [os.path.join(self.root_path, f) for f in os.listdir(self.root_path)
                    if os.path.isfile(os.path.join(self.root_path, f))]
        else:
            return [self.root_path]
1223640
function getFileList(dir, sort = true) {
    return new Promise((resolve, reject) => {
        readdir(dir, (error, files) => {
            if (error) {
                reject(error);
                return;
            }
            let resultantFilesList;

            if (sort) {
                const stripLength = (dir.substr(0, 2) === './') ? dir.length - 1 : dir.length + 1;
                let pathsUnified = files.map((pth => pth.substr(stripLength).replace(/[\\/]/gm, '-')));
                const temporaryIndex = {};
                files.forEach((file, i) => {
                    temporaryIndex[pathsUnified[i]] = file;
                });
                pathsUnified = pathsUnified.sort();
                const filesSorted = [];
                pathsUnified.forEach((key) => {
                    filesSorted.push(temporaryIndex[key]);
                });

                resultantFilesList = filesSorted;
            } else {
                resultantFilesList = files;
            }
            resolve(resultantFilesList);
        });
    });
}
413874
def list_js_files(dir):
    
    for dirpath, dirnames, filenames in os.walk(dir):
        for filename in filenames:
            if is_js_file(filename):
                yield os.path.join(dirpath, filename)
493808
def files
      return [] unless path.exist? && path.directory? && !includes.empty?

      Pathname.glob(%(#{path}/{#{includes.join ","}})).select(&:file?)
    end
416199
def files_list(self, **kwargs) -> SlackResponse:
        """"""
        self._validate_xoxp_token()
        return self.api_call("files.list", http_verb="GET", params=kwargs)
1027787
def get_files_by_path(path):
    '''
    '''
    if os.path.isfile(path):
        return [path]
    if os.path.isdir(path):
        return get_morph_files(path)

    raise IOError('Invalid data path %s' % path)