Controller for listing Files
180225
function FileListController($scope, mediator, $stateParams, $window, userClient, fileMediatorService, $timeout, mobileCamera, desktopCamera, FILE_CONFIG) {
  var self = this;
  self.files = null;
  var _files;
  self.uploadEnabled = FILE_CONFIG.uploadEnabled;
  userClient.getProfile().then(function(profileData){
    var userFilter;
    if(FILE_CONFIG.userMode){
      userFilter = profileData.id;
    }
    
    function refreshFiles(){
      fileMediatorService.listFiles(userFilter).then(function(files){
        $timeout(function(){
          _files = files;
          self.files = files;
        });
      });
    }
  
    refreshFiles();
  
    fileMediatorService.subscribeToFileCRUDDoneTopics($scope, refreshFiles);
  
    self.selectFile = function(event, file){
      self.selectedFileId = file.id;
      mediator.publish(fileMediatorService.fileUITopics.getTopic(CONSTANTS.TOPICS.SELECTED), file);
    };
  
    //TODO: Move to service
    self.applyFilter = function(term){
      term = term.toLowerCase();
      self.files = _files.filter(function(file){
        return String(file.name).toLowerCase().indexOf(term) !== -1
          || String(file.id).indexOf(term) !== -1;
      });
    };
  
    $scope.$parent.selected = {id: null};
    var captureThenUpload = function(){
      if($window.cordova){
        return mobileCamera.capture()
          .then(function(capture){
            var fileData = {
              userId: profileData.id,
              fileURI: capture.fileURI,
              options: {fileName: capture.fileName}
            };
            fileMediatorService.createFile(fileData);
          });
      }else{
        return desktopCamera.capture()
          .then(function(dataUrl){
            return fileMediatorService.createFile({userId: profileData.id, dataUrl: dataUrl});
          });
      }
    };
    self.capturePhoto = function(){
      captureThenUpload().then(function(){
      }, function(error){
        console.error(error);
      });
    };
  });
}
463756
private void listStatus(ArrayList<FileStatus> results, Path f,
      PathFilter filter) throws IOException {
    FileStatus listing[] = listStatus(f);
    if (listing == null) {
      throw new FileNotFoundException("File " + f + " does not exist");
    }
    for (int i = 0; i < listing.length; i++) {
      if (filter.accept(listing[i].getPath())) {
        results.add(listing[i]);
      }
    }
  }
353148
def database_list_folder(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/listFolder' % object_id, input_params, always_retry=always_retry, **kwargs)
457420
def _index_files(path):
        """"""
        with zipfile.ZipFile(path) as zf:
            names = sorted(zf.namelist())
            names = [nn for nn in names if nn.endswith(".tif")]
            names = [nn for nn in names if nn.startswith("SID PHA")]
            phasefiles = []
            for name in names:
                with zf.open(name) as pt:
                    fd = io.BytesIO(pt.read())
                    if SingleTifPhasics.verify(fd):
                        phasefiles.append(name)
            return phasefiles
588096
def list_files_courses(self, course_id, content_types=None, include=None, only=None, order=None, search_term=None, sort=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # OPTIONAL - content_types
        """Filter results by content-type. You can specify type/subtype pairs (e.g.,
        'image/jpeg'), or simply types (e.g., 'image', which will match
        'image/gif', 'image/jpeg', etc.)."""
        if content_types is not None:
            params["content_types"] = content_types

        # OPTIONAL - search_term
        """The partial name of the files to match and return."""
        if search_term is not None:
            params["search_term"] = search_term

        # OPTIONAL - include
        """Array of additional information to include.
        
        "user":: the user who uploaded the file or last edited its content
        "usage_rights":: copyright and license information for the file (see UsageRights)"""
        if include is not None:
            self._validate_enum(include, ["user"])
            params["include"] = include

        # OPTIONAL - only
        """Array of information to restrict to. Overrides include[]
        
        "names":: only returns file name information"""
        if only is not None:
            params["only"] = only

        # OPTIONAL - sort
        """Sort results by this field. Defaults to 'name'. Note that `sort=user` implies `include[]=user`."""
        if sort is not None:
            self._validate_enum(sort, ["name", "size", "created_at", "updated_at", "content_type", "user"])
            params["sort"] = sort

        # OPTIONAL - order
        """The sorting order. Defaults to 'asc'."""
        if order is not None:
            self._validate_enum(order, ["asc", "desc"])
            params["order"] = order

        self.logger.debug("GET /api/v1/courses/{course_id}/files with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/courses/{course_id}/files".format(**path), data=data, params=params, all_pages=True)
164400
def list_archive(archive, verbosity=1, program=None, interactive=True):
    """"""
    # Set default verbosity to 1 since the listing output should be visible.
    util.check_existing_filename(archive)
    if verbosity >= 0:
        util.log_info("Listing %s ..." % archive)
    return _handle_archive(archive, 'list', verbosity=verbosity,
      interactive=interactive, program=program)
1018537
function(req, res, next) {

        /**
         * If you want to redirect to another controller, uncomment
         */

        var controllers = [];

        fs.readdir(__dirname + '/', function(err, files) {

            if (err) {
                throw err;
            }
            files.forEach(function(file) {
                if(/\.js$/i.test(file)) {
                   if (file !== "AppsController.js") {
                       controllers.push(file.replace('Controller.js', '').toLowerCase());
                   }
                }
            });

            res.render('app', {
                controllers: controllers
            });

        });
    }
229507
protected function actionListFile()
    {
        list($selected, $action) = $this->getPostedAction();

        $disk = $db = 0;

        foreach ($selected as $file_id) {
            if ($action === 'delete' && $this->access('file_delete')) {
                $this->file->deleteAll($file_id, $db, $disk);
            }
        }

        if (!empty($selected)) {
            $severity = $disk && $disk == $db ? 'success' : 'warning';
            $message = $this->text('Deleted from database: %db, disk: %disk', array('%db' => $db, '%disk' => $disk));
            $this->setMessage($message, $severity);
        }
    }
1269622
def file_list( files )
    case files
    when String
      [files]
    when Array
      files
    when Proc
      files.call # result should respond to #each
    else
      []
    end
  end
411063
def files(files_list, with_options: {})
      files files_list, with_options: Elm::Options.with(with_options)
    end
81940
def list_files(path):
    """"""
    files = []
    if os.path.isdir(path):
        for stats in os.walk(path):
            for f in stats[2]:
                files.append(os.path.join(stats[0], f))
    elif os.path.isfile(path):
        files = [path]
    return files
597825
def list(path, filename=None, start=None, stop=None, recursive=False, directories=False):
        
        path = uri_to_path(path)

        if not filename and recursive:
            return listrecursive(path)

        if filename:
            if os.path.isdir(path):
                path = os.path.join(path, filename)
            else:
                path = os.path.join(os.path.dirname(path), filename)
        else:
            if os.path.isdir(path) and not directories:
                path = os.path.join(path, "*")

        files = glob.glob(path)

        if not directories:
            files = [fpath for fpath in files if not os.path.isdir(fpath)]

        files.sort()
        files = select(files, start, stop)
        return files
1196212
def file_list(self, page_size: int, fields: str, order_by: str, query: str) -> dict:
        
        service = self.__get_service()
        results = service.files().list(
            pageSize=page_size,
            fields=fields,
            orderBy=order_by,
            q=query
        ).execute()
        return results.get('files', [])
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
1280924
def list_files(path, extension=".cpp", exclude="S.cpp"):
    """"""
    return ["%s/%s" % (path, f) for f in listdir(path) if f.endswith(extension) and (not f.endswith(exclude))]
1254247
def directory_listing(conn: FTP, path: str) -> Tuple[List, List]:
    """"""

    entries = deque()
    conn.dir(path, entries.append)
    entries = map(parse_line, entries)
    grouped_entries = defaultdict(list)

    for key, value in entries:
        grouped_entries[key].append(value)

    directories = grouped_entries[ListingType.directory]
    files = grouped_entries[ListingType.file]

    return directories, files
478577
private void listFiles(File dir, List<File> results) {
        File[] found = dir.listFiles();
        if ( found != null ) {
            for ( File f : found ) {
                if (f.isDirectory()) {
                	//do nothing
                } else {
                    results.add(f);
                }
            }
        }
    }