Go to: Synopsis. Return value. Related. Flags. Python examples. 
      
       getFileList([filespec=string], [folder=string])  
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
      getFileList is undoable, NOT queryable, and NOT editable.
      Returns a list of files matching an optional wildcard pattern.
Note that this command works directly on raw system files and does not go through standard Maya file path resolution.
	  
      
      | string[] | an array of file names | 
      
      sysFile
      
    
      filespec, folder
      
        
          | Long name (short name) | 
          Argument types | 
          Properties | 
        
         | 
    
      
        
          filespec(fs) 
       | 
      
        string
       | 
      
 
       | 
    
    
      
        
          
         | 
          
wildcard specifier for search.
      
           | 
           
         
       | 
    
    
      
        
          folder(fld) 
       | 
      
        string
       | 
      
 
       | 
    
    
      
        
          
         | 
          
return a directory listing
      
           | 
           
         
       | 
    
      
      
        
          
             
                Flag can appear in Create mode of command
             | 
             
                Flag can appear in Edit mode of command
             | 
          
          
             
                Flag can appear in Query mode of command
             | 
             
                Flag can have multiple arguments, passed either as a tuple or a list.
             | 
          
        
import maya.cmds as cmds
# List the contents of the user's projects directory
#
cmds.getFileList( folder=cmds.internalVar(userWorkspaceDir=True) )
# List all MEL files in the user's script directory
#
cmds.getFileList( folder=cmds.internalVar(userScriptDir=True), filespec='*.mel' )