How to Check File Size in 10 Programming Languages
As in the article:
I’ll just post the code for each of them!
file.iso file is fictitious and you must replace it with a valid file on your computer to carry out the tests.
You can compare the result using the command:
du -h file.iso.
gcc filesize.c && ./a.out
g++ filesize.cpp && ./a.out
javac FileSize.java && java FileSize
dotnet new console -o FileSize && cd FileSize && vim Program.cs
go build filesize.go && ./filesizeou
go run filesize.go
Until the next article!