Question
· 4 hr ago

%FileSet Throws “Directory Does Not Exist” for Network Path — But DirectoryExists() Returns 1

Hi Community,

I’m trying to execute a directory query in InterSystems IRIS using %SQL.Statement, but encountering an unexpected error.

Details:
The following command confirms that the directory exists:

Set dirPath="\\MYNETWORK_DRIVE\DFS-Shared_Product\GXM"
Write ##class(%File).DirectoryExists(dirPath)

It returns 1, meaning the path is valid and accessible.

However, when I try to execute this SQL query:

Set File=##Class(%SQL.Statement).%New()
Set Status=File.%PrepareClassQuery("%File","FileSet")
Set Result=File.%Execute(dirPath)
If Result.%SQLCODE {
    Write Result.%Message
}

I get the error:

ERROR #5021: Directory '\\MYNETWORK_DRIVE\DFS-Shared_Product\GXM' does not exist

Interestingly, I can access the same path successfully using the $ZF(-1) command, so it seems to be accessible from the OS level.

Question:
Why does %FileSet report that the directory doesn’t exist, even though it’s accessible both via $ZF(-1) and %File.DirectoryExists()?
Is there any specific configuration or permission requirement for accessing a network path through %FileSet?

Thanks,

Gopal Mani

Product version: IRIS 2022.1
$ZV: IRIS for Windows (x86-64) 2022.1.2 (Build 574U) Fri Jan 13 2023 15:00:26 EST
Discussion (1)2
Log in or sign up to continue