Hi all,
It seems that the behavior of the ReadText node has changed between Dynamo 3.6.0 to Dynamo 4.2.1. Was that change on intend, or is it a bug?
Thanks,
GG (new account, not at home at the moment, and couldn’t find my old account info quickly…)
Hi @m.guenthergeffers try with a File From Path node
Thanks, @sovitek , but while this fixes the script, I would still like to know if this behavior change was on intend?
(I will mark you post as solution once my question is answered
)
yeah have been some changes there i guess, and for me it actuelly make sense as the node ask for the file and not as string (file path) but for System.IO.FileInfo (file)
Hey @m.guenthergeffers, this one was on purpose.
FileSystem.ReadText used to have two versions under the hood. One takes a file object, which is what the file port has always asked for. The other took a string path and ran File From Path for you. That string version was marked obsolete all the way back in Dynamo 1.3.4, with a note to use File From Path > ReadText instead.
In 4.0 the team cleaned out those long-obsolete nodes, and the string version of ReadText went with them: https://github.com/DynamoDS/Dynamo/pull/16676
So your 3.6 graph was running on the old overload without telling you. In 4.x only the file version is left, which is why you now get the “expects System.IO.FileInfo, but was called with string” warning.
The fix is what @sovitek posted:
File Path > File From Path > FileSystem.ReadText
A few other old nodes went out in the same cleanup (ReadImage with a path input, LoadImageFromPath, the old WriteImage and ExportToCSV), so if you have older graphs using those, they will need the same kind of update.
Thanks, @john_pierson , fair enough! ![]()