BS2000 File Filter and Accessing Shared Files of a Foreign User ID

File filter

If a user ID contains files of several projects, you can define filters to select only files of one project. For instance, if there are files of your project, prefixed with myproj., and files of another project, prefixed with otherproj., You can define a filter to select files of your project only. As usual, filters are defined by selecting New > Filter in the context menu of BS2000 files.

If the Show files only option is activated, the list of libraries (POSIX directories) is suppressed.

In the following example the pattern is set to display all files :

After Finish has been clicked the new filter appears in the BS2000 Explorer view and can be expanded:

Properties of a filter can be viewed via the Properties action of its context menu.

To add additional Filter directory click Add directory button. You can specify here e.g. only elements of type S from myproj.plam library. If you select Show files only for Default pubset then our tree will be presented as below:

You can also create or modify Filter directory path manually by providing the correct BS2000 path.

To be more consistent with BS2000 and OpenFT the Filter directories paths in BS2000 Explorer are as follows:

  • $USERID. as path user's default pubset.
  • $USERID.PLAMLIB or PLAMLIB as path to specific BS2000 Plam Library.
  • $USERID.PLAMLIB/X or PLAMLIB/X as path to specific BS2000 Plam Library's Type.
  • :PUBSET:$USERID. as path to user's files on specific pubset
  • / as path to POSIX File System root.
  • /home/user as path to POSIX File System directory: /home/user.

It is also possible to specify multiple pubsets in filter directory by using asterisk "*" wildcard.
For example, filter directory :P*:. will display all files from pubsets starting with "P".

Filters to access shared files owned by another user ID

Shared files owned by other user IDs can be accessed by defining an appropriate filter. Here is an example of a filter for some shared files in user ID $TSOS:

Expanding this filter delivers:

Creating Filter Strings

In BS2000 Explorer you can define the Filter Strings in two different ways. The first one is default wildcard pattern and the second way is by using regular expression. To use regular expressions you need to select Regular expression (ASCII) during creation or modification given Filter String. Here is the example of filter string displaying only files that contains 3 digits in name:

To use regular expressions by default, you need to select Enable regular expressions in Filter Strings in command link Window > Preferences > BS2000 Remote IDE > BS2000 Explorer. After change confirmation, each new Filter String will be created as regular expression by default (note that this mechanism will not convert existing wildcart patterns).

The BS2000 Explorer does not support Starts with (^), Ends with ($) and separator (|) notation in Regular Expressions:
  • If file name must starts from given sign (for e.g. "S") then you need to provide regular expressions as S.*. The same methods must be applied for files ending with given sign: .*S.
  • If you provide just: S as regular expression, then only file (or Plam library) with name "S" will be displayed.
  • To display all files containing (or starts / ends with) "S" then you need to set Filter String as: .*S.* (regular expressions is fully matched)
The above rules also apply for standard Filter String but instead of ".*" you need to use "*" wildcard.

Filter Strings used to filter out BS2000 files are not case sensitive in contrast with POSIX files (where case sensitivity while filtering is taken into account).

Nested filter strings

BS2000 Explorer provides mechanism for handling nested filter string. This means that you can now use slash (/) to separate patterns for sub-directories (for e.g. elements of Plam Libraries). To display all files in Default pubset that starts with myproject and to show only elements of type S of Plam Libraries (if any) we need to create filter string:

(For regular expressions you need to use Filter String: myproj.*/s/.*)

Here is example of using such Filter (myproj.plam and myproject.lib contains more library types):