See the attached CopyToFile1.PNG for details.
Fixed by correcting the initialization of the _file member by this change to Writer.cs:
@@ -140,8 +140,8 @@ namespace FluidEarth2.AdaptedOutputs
public override void Initialize()
{
- _file = Argument(GetArgumentIdentity(WriterArgs.FilePath))
- .Value as FileInfo;
+ _file = (Argument(GetArgumentIdentity(WriterArgs.FilePath))
+ .Value as ArgumentValueFile).Value;
_formatDateTime = Argument(GetArgumentIdentity(WriterArgs.FormatDateTime))
.Value as string;
Having made the above change Copy To File Adapter always throws an exception if the file to be writtent does not exist. See the attached CopyToFile2.PNG for details.
Fixed by this change to Writer.cs:
@@ -157,7 +157,7 @@ namespace FluidEarth2.AdaptedOutputs
{
base.PrepareIt();
- if (_file.IsReadOnly)
+ if (_file.Exists && _file.IsReadOnly)
throw new Exception("File readonly");
if (_file.Exists)
Anonymous
Add missing attachement.