Couldn't find file while using "file Info"

Hi ,

I have used ‘New System.IO.FileInfo(“in_file”).Length’ to get the size of file(text file).But while executing , getting error as " Couldn’t find the file ‘in_file’" even though file is available in same folder.

Thanks,
Ananth

@Ananthakumar_sarguru - could you share the files path, and what you have in “in_file”?

Make sure the path is not a Directory… And the robot has permission to access the path…

Thanks Sumit for helping me out. PFB folder path and file details

Thanks,
Ananth

@Ananthakumar_sarguru - try “in_file.txt” ?

1 Like

Thanks @bcorrea for helping me out.

i have given file name directly instead of path.

sizeinbytes=New System.IO.FileInfo(“in_file”).Length

Thanks,
Ananth

you should provide the full path…

1 Like

Thanks @sumitd.It worked and i got size of the file.

Perfect!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.