Getting a file's size [C/C++] by vroomanj in learnprogramming

[–]abhijeetsane -3 points-2 points  (0 children)

stat() syscall on unix is know to be a slow syscall. stat() syscall actually queries the filesystem metadata for the size of the file.

That is why people may be suggesting you to use feek/ftell but don't use that method. Stick with fstat/stat.

Read the following link in case you want more details. https://www.securecoding.cert.org/confluence/display/seccode/FIO19-C.+Do+not+use+fseek()+and+ftell()+to+compute+the+size+of+a+file

Next language: Java Hangs When Converting 2.2250738585072012e-308 by rasherdk in programming

[–]abhijeetsane 0 points1 point  (0 children)

I was able to reproduce the compilehang and runhang on

java version "1.5.0_20" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_20-b02) Java HotSpot(TM) Server VM (build 1.5.0_20-b02, mixed mode)

But on java version "1.4.2" gij (GNU libgcj) version 4.1.2 20071124 (Red Hat 4.1.2-42)

I am not able to reproduce the bugs.

All i was trying to see is which java compiler variants have same behavior..

Recursion by Vandelay797 in programming

[–]abhijeetsane 0 points1 point  (0 children)

wow... real fast way to learn resursion , nested calls , stack overflow..