List Files for Windows OS

        Search and list the files and folder in the current directory for the
        Windows file system.

        @return: List of directory files and folders.
493976
def _listFilesWin(self) -> ['File']:
        

        output = []
        for dirname, dirnames, filenames in os.walk(self._path):
            for subdirname in dirnames:
                output.append(os.path.join(dirname, subdirname))
            for filename in filenames:
                output.append(os.path.join(dirname, filename))
        return output
656202
def list_directory(self, *args, **kwargs):
		
		return tuple(self.dav_client().list(self.session_path()))
1017263
def retrieve_files():
    

    all_files = []
    for location in cfg.CONF.locations or []:
        # if local path then make sure it is absolute
        if not location.startswith('\\'):
            location = os.path.abspath(os.path.expanduser(location))

        LOG.debug('searching [%s]', location)
        for root, _, files in os.walk(location):
            LOG.debug('found file(s) %s', files)
            for name in files:
                filepath = os.path.join(root, name)
                if (os.access(filepath, os.R_OK) and
                        not _is_blacklisted_filename(filepath) and
                        _is_valid_extension(os.path.splitext(name)[1])):
                    all_files.append(filepath)

    return all_files
918954
public java.util.List<FileSystemDescription> getFileSystems() {
        if (fileSystems == null) {
            fileSystems = new com.amazonaws.internal.SdkInternalList<FileSystemDescription>();
        }
        return fileSystems;
    }
463686
def files(self):
        
        return [
            os.path.join(self.root, label, name)
            for label in self.labels
            for name in os.listdir(os.path.join(self.root, label))
        ]
748426
def list_files(x, path=""):
    
    logger_directory.info("enter list_files")
    file_list = []
    if path:
        # list files from target directory
        files = os.listdir(path)
        for file in files:
            if file.endswith(x) and not file.startswith(("$", "~", ".")):
                # join the path and basename to create full path
                file_list.append(os.path.join(path, file))
    else:
        # list files from current working directory
        files = os.listdir()
        for file in files:
            if file.endswith(x) and not file.startswith(("$", "~", ".")):
                # append basename. not full path
                file_list.append(file)
    logger_directory.info("exit list_files")
    return file_list
674075
def folders(self):
        
        if self._folders is None:
            self.__init()
        if "/" not in self._folders:
            self._folders.append("/")
        return self._folders
410399
def list_path(root_dir):
    
    res = []
    if os.path.isdir(root_dir):
        for name in os.listdir(root_dir):
            res.append(name)
    return res
122729
def get_file_systems(self):
        
        result = {}
        if os.access('/proc/mounts', os.R_OK):
            file = open('/proc/mounts')
            for line in file:
                try:
                    mount = line.split()
                    device = mount[0]
                    mount_point = mount[1]
                    fs_type = mount[2]
                except (IndexError, ValueError):
                    continue

                # Skip the filesystem if it is not in the list of valid
                # filesystems
                if fs_type not in self.filesystems:
                    self.log.debug("Ignoring %s since it is of type %s " +
                                   " which is not in the list of filesystems.",
                                   mount_point, fs_type)
                    continue

                # Process the filters
                if self.exclude_reg.search(mount_point):
                    self.log.debug("Ignoring %s since it is in the " +
                                   "exclude_filter list.", mount_point)
                    continue

                if ((('/' in device or device == 'tmpfs') and
                     mount_point.startswith('/'))):
                    try:
                        stat = os.stat(mount_point)
                    except OSError:
                        self.log.debug("Path %s is not mounted - skipping.",
                                       mount_point)
                        continue

                    if stat.st_dev in result:
                        continue

                    result[stat.st_dev] = {
                        'device': os.path.realpath(device),
                        'mount_point': mount_point,
                        'fs_type': fs_type
                    }

            file.close()

        else:
            if not psutil:
                self.log.error('Unable to import psutil')
                return None

            partitions = psutil.disk_partitions(False)
            for partition in partitions:
                result[len(result)] = {
                    'device': os.path.realpath(partition.device),
                    'mount_point': partition.mountpoint,
                    'fs_type': partition.fstype
                }
            pass

        return result
452386
def listfile (self):
        
        if not self.filename:
            return
        files = self.get_files()
        log.debug(LOG_CHECK, "FTP files %s", str(files))
        if self.filename in files:
            # file found
            return
        # it could be a directory if the trailing slash was forgotten
        if "%s/" % self.filename in files:
            if not self.url.endswith('/'):
                self.add_warning(
                         _("Missing trailing directory slash in ftp url."),
                         tag=WARN_FTP_MISSING_SLASH)
                self.url += '/'
            return
        raise ftplib.error_perm("550 File not found")
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
71604
def recursively_get_files_from_directory(directory):
    
    return [
        os.path.join(root, filename)
        for root, directories, filenames in os.walk(directory)
        for filename in filenames
    ]
914247
def _listdir(self, root):
        ""
        res = []
        for name in os.listdir(root):
            path = os.path.join(root, name)
            if os.path.isdir(path):
                name += os.sep
            res.append(name)
        return res
888397
def get_system_drives():
    
    drives = []
    if os.name == 'nt':
        import ctypes
        bitmask = ctypes.windll.kernel32.GetLogicalDrives()
        letter = ord('A')
        while bitmask > 0:
            if bitmask & 1:
                name = chr(letter) + ':' + os.sep
                if os.path.isdir(name):
                    drives.append(name)
            bitmask >>= 1
            letter += 1
    else:
        current_drive = get_drive(os.getcwd())
        if current_drive:
            drive = current_drive
        else:
            drive = os.sep
        drives.append(drive)

    return drives
419876
def dir_list(load):
    '''
    
    '''
    ret = set()
    files = file_list(load)
    for f in files:
        dirname = f
        while dirname:
            dirname = os.path.dirname(dirname)
            if dirname:
                ret.add(dirname)
    return list(ret)
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
1075168
def _walk_directory(root_directory):
        

        paths = [os.path.join(root, name)
                 for root, dirs, files in os.walk(root_directory)  # noqa
                 for name in files]
        paths.sort()
        return paths