File#size and File#size? follow links?

J

John Joyce

Do File#size and File#size? follow links?
It would certainly appear to be so, but docs don't say.
Don't symlinks have a size of some sort of their own?
Kind of confused by this. (Hard links are a bit more of a mind-bender
at times. I'm afraid to create or use them for fear of black holes. )
 
D

Daniel Berger

Do File#size and File#size? follow links?
It would certainly appear to be so, but docs don't say.
Don't symlinks have a size of some sort of their own?
Kind of confused by this. (Hard links are a bit more of a mind-bender
at times. I'm afraid to create or use them for fear of black holes. )

Yes, it follows links. If you want to report on the size of the link
itself, use File.lstat('link').size.

Regards,

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top