Hello Li,
Your post was cross-posted to the US developer community. Here's my first impression (copied from the other forum):
If this is on Windows I suspect this is an issue with using the default SYSTEM account. See the following doc:
Installing InterSystems IRIS on Microsoft Windows > Windows User Accounts
"When installing InterSystems IRIS, you must choose the Windows user account to run the InterSystems service. There are two options:
The default SYSTEM account (Windows Local System account). This is used in Minimal security installations.
A defined Windows user account.
Running the Windows InterSystems service under the default SYSTEM account is appropriate for many installations, but in some cases can cause issues relating to file permissions and network security access. If you anticipate potential problems in these areas for an InterSystems IRIS instance, for example due to your network configuration or security arrangements, specify an account for the Windows InterSystems service that has the needed privileges and/or access, such as a domain administrator account.
For instructions on how to change the service account after installation, see the Managing Windows User Access to the InterSystems IRIS Instance section."
Changing the InterSystems Service Account
<install-dir>\bin\IRISinstall.exe setserviceusername <instance-name> <username> <password>
Li, I'm not sure exactly what you want to do, but I'd start by reviewing the %Library.File class reference, and this %Library.File documentation "Using %Library.File".
You may find the stream documentation useful as well.