Package jason.stdlib

Class list_files

java.lang.Object
All Implemented Interfaces:
InternalAction, java.io.Serializable

@Manual(literal=".list_files(path,pattern)",
        hint="lists files of a folder",
        argsHint={"path to be listed","a regular expression file names should match [optional]"},
        argsType={"string","string"},
        examples={".list_files(\"./\",R): unifies R with the list of all files in the working directory and subdirectories",".list_files(\"./src/agt\",\".*.asl\",L): unifies L with the list of all \'.asl\' files in the directory and subdirectories",".list_files(\"/media/movies\",\".*[(][0-9]{4}[)].*\",L): unifies L with the list of all files in \'/media/movies\' in which the name contains 4 numbers between parenthesis."},
        seeAlso={"jason.stdlib.create_agent","jason.stdlib.save_agent"})
public class list_files
extends DefaultInternalAction

Internal action: .list_files.

Description: lists files of a folder

Parameters:

  • + path (string): path to be listed.
  • + pattern (string -- optional): a regular expression file names should match.

Examples:

  • .list_files("./",R): unify in R the list of all files in the working directory and its subdirectories.
  • .list_files("./src/agt",".*.asl",L): unify in L the list of all '.asl' files in the directory '.src/agt/' and its subdirectories (e.g. [./src/agt/bob.asl, .src/agt/alice.asl])
  • .list_files("/media/movies",".*[(][0-9]{4}[)].*",L): unify in L the list of all files in '/media/movies' in which the name contains 4 numbers between parenthesis.
See Also:
create_agent, save_agent, Serialized Form