File#size and File#size? follow links?

Discussion in 'Ruby' started by John Joyce, Apr 27, 2007.

  1. John Joyce

    John Joyce Guest

    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. )
     
    John Joyce, Apr 27, 2007
    #1
    1. Advertising

  2. On Apr 27, 7:57 am, John Joyce <>
    wrote:
    > 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
     
    Daniel Berger, Apr 27, 2007
    #2
    1. Advertising

  3. John Joyce

    John Joyce Guest

    On Apr 27, 2007, at 11:45 PM, Daniel Berger wrote:

    > On Apr 27, 7:57 am, John Joyce <>
    > wrote:
    >> 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
    >
    >

    Thanks, Dan!
     
    John Joyce, Apr 27, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?=A0?=
    Replies:
    0
    Views:
    427
    =?ISO-8859-1?Q?=A0?=
    Jan 10, 2004
  2. Benny Ng
    Replies:
    0
    Views:
    361
    Benny Ng
    Jan 16, 2007
  3. Abhijit D. Babar
    Replies:
    0
    Views:
    367
    Abhijit D. Babar
    May 21, 2008
  4. Danny
    Replies:
    3
    Views:
    154
    Danny
    Apr 12, 2004
  5. Replies:
    3
    Views:
    169
    nolo contendere
    Apr 29, 2008
Loading...

Share This Page