Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1 glark does not like symlinks

open
nobody
None
5
2006-02-07
2006-02-07
xspikx
No

While banchmarking glark and grep I noticed that glark
does not recognize looping symlinks.

In my /var/tmp directory i have a symlink "tmp" that
points back to /var/tmp.
Glark did not skip this, just kept looping for about 63
minutes until it stopped.
Grep however finished within a minute.

Command used:
grep -re --binary-files=without-match "arguments" .

Discussion

  • Jeff Pace
    Jeff Pace
    2006-02-27

    Logged In: YES
    user_id=316860

    Thanks for the feedback. That will be fixed in 1.7.8.

     
  • Logged In: NO

    Ruby has: File.symlink? filename
    So this should be a nice and easy fix.
    [I just noticed you're follow up below so this is probably all very moot.]

    Test on command line:
    1) Create a file
    $ echo "test" > in

    2) Create a symlink from that file
    $ ln -s in in0

    3) Check if its a symlink (the "l" in the directory spot and the "in0 --> in"
    $ ls -l in0
    lrwxr-xr-x 1 joe joe 2 Mar 6 17:34 in0 -> in

    4) Check what ruby thinks of it
    $ ruby -e "puts File.stat('in0').ftype"
    file

    5) Does Ruby's symlink? function find it, yes
    $ ruby -e "puts File.symlink?('in0')"
    true

    Its up to you but I think you could simply add this function call to FileTester#test, just a simple check for a symlink and make it UNREADABLE or have options to follow it. (I don't actually know what grep does in this instance).

     
  • Logged In: NO

    And sure enough this has been fixed already. So my bad again.
    Change the status?