Forum Discussion

Erika's avatar
Erika
New Contributor
4 months ago

Error trying to read a file from a local fileshare using SIC

Hello,

I'm tying to read files from an azure fileshare mount as a disc unit in the same server  where SIC is installed. I guess this has to works as a disc unit C:/ but the business rule throws an execution error

Could not find a part of the path 'z:\\Temp\\zw_2023.csv'.

this is part of the code that I'm using

Public Sub CleanupData(ByVal si As SessionInfo)

Dim objRemoteRequestResultDto As RemoteRequestResultDto = BRApi.Utilities.ExecRemoteGatewayBusinessRule(si, "TestFile", Nothing, "remote_test", "DeleteOldFileData")

If (objRemoteRequestResultDto.RemoteResultStatus = RemoteMessageResultType.RunOperationReturnObject) Then
Dim result As Boolean

result = objRemoteRequestResultDto.ObjectResultValue

Dim objRemoteRequestResultDtoCached As RemoteRequestResultDto = BRApi.Utilities.ExecRemoteGatewayCachedBusinessRule(si, "TestFile", Nothing, "remote_test", 90)

BRApi.ErrorLog.LogMessage(si, "File Deleted: " & result)
Else
If (Not (objRemoteRequestResultDto.remoteException Is Nothing)) Then
Throw ErrorHandler.LogWrite(si, New XFException(si,objRemoteRequestResultDto.remoteException))
End If
End If
End Sub

For the remote BR

public bool DeleteOldFileData()
{
string fname = @"z:\Temp\hw_2023.csv";
try
{
System.IO.File.Delete(fname);
return true;
}
catch (IOException)
{
return false;
}
}