I could not find a previous topic on this error message, "The process cannot access the file 'c:\tmp\crdt1.txt' because it is being used by another process."
Seems to be some sort of a file synchronization/flushing issue when parsing 839 symbols using the Multisymbol backtest function on EOD data. About 221 unique symbols are being written out to the file. I do a flush of the StreamWriter object, but not the FileStream object.
Any thoughts on how to resolve this problem?
CODE:
Please log in to see this code.
Size:
Color:
Try wrapping the file access in a using block. Google it for more info.
Size:
Color:
It took some hunting, but thanks for the clue Dave! I am posting the fix in case anyone else stumbles across this problem. It appears that the StreamWriter() call was returning an error. Waiting until it no longer has an error fixed the problem.
CODE:
Please log in to see this code.
Size:
Color:
Hi Mike,
Could you repost the entire script? Thanks.
Size:
Color:
Here is the updated script:
CODE:
Please log in to see this code.
Size:
Color: