Forever going deeper into \sys folder?


Last Updated:

  1. jfbaro

    jfbaro Well-Known Member This Topic's Starter

    Joined:
    Jan 7, 2010
    Messages:
    62
    Likes Received:
    0
    Hi,

    I have tested this behaviour on both a N1 and the emulator. Could anyone tell me if that is a problem? I don't think it would go forever. How can I avoid the recursive code going forever? What is happening?

    If you use any file browser/manager and starting going into /sys/devices/w1 bus master/subsystem/devices/w1 bus master/subsystem it will go inner forever, repeating that pattern devices/w1 bus master/subsystem/ forever.

    So when I run a recursive search it keeps going deeper and deeper and seems never to finish.

    What is happening, how to avoid this behaviour?

    I tried different file manager and they all seems to be going forever into these folders, although when I do a search through Astro it doesn't seem to get stuck with this loop (It seems to ignore the /sys folder, but I am not sure if this happens also in any other folder).

    Regards.
     

    Advertisement
  2. KlaymenDK

    KlaymenDK Well-Known Member

    Joined:
    May 29, 2009
    Messages:
    1,217
    Likes Received:
    130
    I haven't checked that, but it sounds like a circular link.

    You know unix-style links? Sort of like Windows-style shortcuts, but they look a lot more like the actual destination instead of just being a shortcut file. So, if you have one folder inside another, and you create a link to the outer folder within the inner, you would end up with something you could navigate as you describe. In that case, there is no end, it will go on forever (or until you run out of stack memory).
     
  3. jfbaro

    jfbaro Well-Known Member This Topic's Starter

    Joined:
    Jan 7, 2010
    Messages:
    62
    Likes Received:
    0
  4. Scythe

    Scythe Well-Known Member

    Joined:
    Apr 6, 2010
    Messages:
    106
    Likes Received:
    27
    Java using a typical File cannot determine a soft link. I bet that Astro just has an "if starts with /sys then break" statement or similar.
     
  5. jfbaro

    jfbaro Well-Known Member This Topic's Starter

    Joined:
    Jan 7, 2010
    Messages:
    62
    Likes Received:
    0
    Hi,

    There must be an answer for that! Can that be done with NDK?

    Cheers
     
  6. Scythe

    Scythe Well-Known Member

    Joined:
    Apr 6, 2010
    Messages:
    106
    Likes Received:
    27
    You could definitely determine soft links via the NDK. It's a lot more work to code that however.
     

Share This Page

Loading...