Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I use tfileproperties to get the size of a file but it produces null
I have expression below
row2.size!=null?"Create XML Success, With Size = "+Long.toString(row2.size/1024)+" KB":"Create XML Success, With Size = "+row2.size+" KB"
But return null
even though the file is formed and its size is 5kb
Can anyone help me why it produces null when it should contain a value?
Hello
The result of this calculation row2.size/1024 is an integer, because the file size is too small (5 KB less than 1024), so its result is 0. You will have the exact file size with the expression:
row2.size!=null?"Create XML Success, With Size = "+row2.size+" KB":"The file is empty"
Regards
Shicong
Ensure that you are passing the correct file path to the component. If the file path is incorrect, it may result in null values.
Hello
The result of this calculation row2.size/1024 is an integer, because the file size is too small (5 KB less than 1024), so its result is 0. You will have the exact file size with the expression:
row2.size!=null?"Create XML Success, With Size = "+row2.size+" KB":"The file is empty"
Regards
Shicong