2.4 Calls on file and context objectslegion_activate_instances {[-c] <class context name> | -l <class LOID>} [-debug] [-help] Activates all instances of the class named in <class context path> or <class LOID>. Instances that are already active will be unaffected. The following options are supported:
legion_allow_activation [-entire_class] [-debug] [-help] {[-c] <context path> | -l <LOID>} Activates the object or instances of the class named in <context path> or <LOID>. It should be used in association with the-stay_down option of legion_deactivate_object or legion_deactivate_instances (page 16 and page 29, respectively). The following options are supported:
legion_cat <context path1> <context path2> ... <context pathN> [-debug] [-help] Prints the contents of the Legion file object(s) named in <context path> to standard output. It is similar to the Unix cat command. The following options are supported:
legion_cd <context path> [-debug] [-help] Changes the current working context to the context named in <context path>. Note that the path name can be relative or absolute. This command is analogous to the Unix cd command. The following options are supported:
legion_context_add <object LOID> <context name> [-debug] [-help] Adds a new name <context name> for the object named in <object LOID> to the current context space. The following options are supported:
legion_context_create <context path> [-debug] [-help] Creates a new context in Legion context space, and assigns it the name given in <context path>. This command is analogous to the Unix mkdir command. The new context will be placed in your current context. The following options are supported:
legion_cp [-r] [-v] [-m] [-p] [-localsrc] [-localdest] [-V <vault context path>] <source path> <destination path> [-debug] [-help] Copies the file object or tree named in <source path> (named as either a context path or a local path) to a new, duplicate, file object or tree named in <destination path> (named as either a context path or a local path). Use the recursive mode (-r) to export objects to local file space. Analogous to the Unix cp command. For example, to copy the file object Foo to /home/myContext/Bar, you would enter:
This copies the contents of Foo in the new file object Bar in the /home/myContext path. You can now use wildcards in the <source path> parameter (for context space or local file space). Please note that you must escape the "*" character. The example below copies all files that start with "Foo" from local directory space into the /home/myContext context.
The new file objects are assigned the same names (e.g., if Foo\* finds Foo1 and Foo2, the duplicate file objects will be at /home/myContext/Foo1 and /home/myContext/Foo2). Note that you cannot use wildcards in a destination path and you cannot copy multiple files to a single file object. The following optional parameters are supported:
legion_deactivate_instances [-stay_down] [-debug] [-help] {[-c] <class context name> | -l <class LOID>} Deactivates all instances of the class named in <class context path> or <class LOID>. Instances that are already deactivated will be unaffected. The following options are supported:
legion_destroy_instances {[-c] <class context name> | -l <class LOID>} [-debug] [-help] Destroys all instances of the class named in <class context path> or <class LOID>. Any active instances are deactivated. This command will remove the LOIDs of the specified class' instances in all contexts, not just the current context. However, it will not remove any context name associated with this object: you must use the legion_rm command to remove the object's name(s), or you will get binding errors. (You can use legion_ls -A to check for multiple context names.) The following options are supported:
legion_direct_output {[-c] <object context path> | -l <object LOID>} {[-c] <tty context path> | -l <tty LOID>} [-debug] [-help] Causes the object named in <object path> or <object >LOID> to direct its output (standard out and standard error) to the Legion tty object named by <tty context path> or <tty LOID>. Note that this command can only be invoked on objects that have dynamic output redirection enabled. If the command is invoked on an object that does not have redirection enabled, neither the object nor the tty is affected and an error message is displayed. The following options are supported:
legion_export_dir [-v] [-help] [-noserver] [-autorehash] <local directory path> <target context path> The legion_export_dir command allows a complete directory tree in the local file system to be temporarily linked into Legion context space. A new context is created to replicate the local directory tree in context space. The files contained in the shared directory are copied in to Legion objects in the new context. The new context objects have the same names as the original files. For example, if the local directory contains three files called foo.txt, foo.doc, and foo.c, the new context will contain three Legion objects called foo.txt, foo.doc, and foo.c. The command executes for as long as you wish: if you pause the command the tree's context space will not be available. Once you resume the command, the context will again be available. To pause the command, run legion_export_dir_quit (below) or (if the command was started in -noserver mode) press ^-C. To resume using the exported files, re-execute the command, specifying the same local base directory path and target context path. You can also run legion_rm -r on the new context, which will recursively delete the context and its contents, to stop the command. You can make changes to the shared local directory while the command is running, but those changes won't be reflected in context space unless you use the -autorehash flag or run legion_export_dir_rehash (below). The following parameters are required: The following options are supported:
legion_export_dir_quit <target context path> To be used in conjunction with legion_export_dir (above). Pauses legion_export_dir for the specified context path. The following parameter is required:
legion_export_dir_rehash <target context path> To be used in conjunction with legion_export_dir (page 30). Tells the command to check the shared local directory for any changes and to update the shared context space accordingly. The following parameter is required:
legion_get_host {[-c] <object context name> | -l <object LOID>} [-debug] [-help] This command looks up and returns the LOID of the host on which the object named in <object context path> or <object LOID> currently resides. The following options are supported:
legion_get_vault {[-c] <object context name> | -l <object LOID>} [-debug] [-help] Returns the LOID of the vault which the object named in <object context path> or <object LOID> is currently using to store its OPR. The following options are supported:
legion_list_names {[-c] <object context name> | -l <object LOID>} [-debug] [-help] Lists all of the given object's context names. This includes names assigned by other users. The following options are supported:
legion_ln <context path> <new alias> [-debug] [-help] Assigns an additional name, given in <new alias>, to the object named in <context path>. Analogous to the Unix ln command. Path names can be relative or absolute. An object can have multiple context names, assigned by one or more users. The same context name can be assigned to different objects or to the same object so long as the contexts names are in different contexts (just as the same file names can be used in different levels of a Unix directory). The following options are supported:
legion_ls [-laLRAdqv] [<context path>] [-debug] [-help] Lists the contents of a named Legion context in ascii-alphabetical order. Note that the pathname can be relative or absolute. The command is analogous to the Unix ls command. The default setting lists the current context. You can include a context path in the <context path> parameter to list the contents of that context. For example: You can get more specific information (object type, LOID, other context aliases, state) about objects with the flags. For example, you can get more information about a particular context's objects with the -l, -a, and -A flags. The output below shows a complete list of all objects listed in this context, the objects' types, and any context aliases associated with each listed object.
According to this, there are four names listed in /hosts, two referring to contexts and two to objects. We can see from the alternative context names, though, that BootstrapHost and my.host.DNS.name refer to the same object. You can now use wildcards in the <context path> parameter. Please note that you must escape the "*" character. I.e., to search for context objects containing "foo" in their names you would enter:
You cannot use wildcards with the -R flag. Optional parameters do the following:
legion_mkdir <context path> [-debug] [-help] Creates a new context in Legion context space, and assigns it the name given in <context path>. This command is analogous to the Unix mkdir command (it is also identical to the legion_context_create command). The new context will be placed in your current context. The output will contain the new context's location and its LOID. The following options are supported:
legion_mv <context path> <new context path> [-debug] [-help] Assigns a new context name, given in <new context path> to the object named in <context path>. Pathnames can be relative or absolute. Analogous to the Unix mv command. The following options are supported:
legion_pwd [-debug] [-help] Prints your current context path. Similar to the Unix pwd command. The following options are supported:
legion_rm [-r] [-f] [-v] <context path list> [-debug] [-help] Removes the context path[s] named in <context path list> from Legion context space. Pathnames can be relative or absolute. Analogous to the Unix rm command. If the context path listed is the last (i.e., only) name mapped to a given object, the object will be destroyed. You can now use wildcards in the <context path list> parameter. Please note that you must escape the "*" character. I.e., to remove all context objects containing "foo" in their names you would enter:
Optional parameters do the following:
legion_set_tty <tty context path> [-debug] [-help] This command will set an environment variable to indicate which tty object should be used by subsequent programs. (Please see page 75 in the Basic User Manual for a discussion of tty objects.) By selecting a new current tty object, users can redirect the output to any window or file.
Note that program output does not have to be directed to the same window in which the program is run. By setting a new current tty object, the output can be redirected to any window, or even a file. For example: creates a tty object whose output is sent to a file. To view the tty output, use the legion_tty_watch command (below). The following options are supported:
legion_tty <tty context path> [-debug] [-help] This command can be used to direct all output from a particular shell back to that shell (i.e., create and set a tty object for a shell) in one step, rather than running legion_create_object, legion_set_tty, and legion_tty_watch. If no tty object exists at the path named in <tty context path> it creates a new object, sets it as the target tty, and starts the legion_tty_watch process in the background of the shell in which the command was run. If a tty object already exists at the named context path, the command sets that tty object as the target. Please see page 75 in the Basic User Manual for a discussion of tty objects. The following options are supported:
legion_tty_off [-debug] [-help] Unsets (stops) the Legion tty object for the current shell so that Legion programs executed in that shell after legion_tty_off is run will not display their output to a Legion tty object. This command also shuts off the background legion_tty_watch process for the current shell. This command only works on tty objects that have been set with the legion_tty command. See legion_tty_watch for information on turning off other tty objects. Please see page 75 in the Basic User Manual for a discussion of tty objects. Note that this does not destroy the tty object. The object can be reused with legion_tty, legion_set_tty, or legion_tty_watch. The following options are supported:
legion_tty_redirect <object context path> [-debug] [-help] Causes the Legion tty object currently set in the shell environment to stream directly into the file object named in <object context path>. If the file does not already exist the system creates it. Existing files are appended to, not truncated. A single tty object can be simultaneously directed into any number of files (as well as watched from any number of terminal windows). Please see page 75 in the Basic User Manual for a discussion of tty objects. The following options are supported:
legion_tty_unredirect <object context path> [-debug] [-help] Causes the Legion tty object currently set in the shell environment to stop streaming into the file object named in <object context path>. If the tty object is not currently directing output to the named file the command is ignored. Please see page 75 in the Basic User Manual for a discussion of tty objects. The following options are supported:
legion_tty_watch [[-c] <tty context path> | -l <tty LOID>] [-debug] [-help] Causes output written to a Legion tty object to be printed to standard output. If no command line parameters are specified, the current tty object set for the shell session is selected. Otherwise, the tty object named in <tty LOID> or <tty context path> is selected. Note, the command will not self-terminate: to stop the program send it a SIGINT (i.e., using ^C or "kill -INT"). Any number of legion_tty_watch sessions may simultaneously watch the same Legion tty object. Please see page 75 in the Basic User Manual for a discussion of tty objects. The following options are supported:
legion_2drm <file name> This command removes a 2D file object from Legion. It differs from legion_rm in that the object's subfiles are removed as well. If you use legion_rm to remove a 2D file object, the object's subfiles will not be removed. The following parameter must be included:
legion@Virginia.edu
|