System.IO.Directory doesn't work in runbasebatch

Hello,

I’m using the following method to read files .txt from a server directory, and it works if called from a job but doesn’t found the directory if called from a runbase batch class using same path. Any idea?

public static container importFilesTxt(FilePath _filePath)
{

container list;
int i;
InteropPermission interopPerm;
System.Array files;
str fname;
;

if (_filePath)
{
interopPerm = new InteropPermission(InteropKind::ClrInterop);
interopPerm.assert();

if (System.IO.Directory::Exists(_filePath))
files = System.IO.Directory::GetFiles(_filePath, ‘*.txt’);
else
throw error(strfmt(“Path %1 not found”, _filePath));

for( i=0; i<ClrInterop::getAnyTypeForObject(files.get_Length()); i++ )
{
fname = ClrInterop::getAnyTypeForObject(files.GetValue(i));
list += [SysListSelect::packChoice(fname, i ,false)];
}

CodeAccessPermission::revertAssert();
}
else
throw error (“Path has to be passed as parameter to the static method”);

return list;
}