08-26-05 07:50 AM
I'm trying to "write to" and "read from" a file in my orchestration, but
keep getting an XLANG "Cannot access a closed file" errors. I'm using this
code in and Expression shape:
fs = System.IO.File.Open(sFilePath, System.IO.FileMode.OpenOrCreate,
System.IO.FileAccess.ReadWrite);
fsw = new System.IO.StreamWriter(fs);
fsr = new System.IO.StreamReader(fs);
fsw.WriteLine(sBatchName);
fsw.Close();
while (sTemp != null)
{
sTemp=fsr.ReadLine();
..
}
fsr.Close();
All the variables are defined in the orchestation. I've tried not closing
fsw and fsr, but that just results in a different error about fs "object
FileStream is not serializable". Does anyone have a better way to do this
(ie one that doesn't cause errors)?
Thanks,
Jeff
[ Post a follow-up to this message ]
|