ToolTalk User's Guide

Is file scope in static patterns the same as file_in_session scope?

No, these scopes have different purposes.

For example, assume all sessions currently have the same static patterns and at least one pattern P that will match a message M (which you will be sending). No session has any clients that have registered interest in the file foo.bar.

You are connected to session A and issue a file-scoped message M for file foo.bar. Since no client of any session has previously expressed any interest in this file, session A is the only file that will get the message. (The message will match against static pattern P in session A.) Once the ptype is started, the pattern actually becomes scoped to file (within that session) and session A will honor all the promises.

However, if all sessions do not have the same static patterns, the results are different. For example, session B could have an extra pattern P' that is file-scoped and that should match message M. When message M is sent in session A, the dbserver will not send the message to session B if no client of session B has previously expressed interest in the file foo.bar. However, if a client of session B has previously expressed interest in the file foo.bar, then the dbserver would know that at least one client in that session was interested in the file foo.bar and would send also the message to session B.