1. Download our Official Android App: Forums for Android!

Apps Forever going deeper into \sys folder?

Discussion in 'Android Development' started by jfbaro, Apr 6, 2010.

  1. jfbaro

    jfbaro Member
    Thread Starter
    15

    Jan 7, 2010
    62
    0
    15
    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 Android Expert
    143

    May 29, 2009
    1,217
    130
    143
    Denmark
    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 Member
    Thread Starter
    15

    Jan 7, 2010
    62
    0
    15
  4. Scythe

    Scythe Well-Known Member
    43

    Apr 6, 2010
    106
    27
    43
    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 Member
    Thread Starter
    15

    Jan 7, 2010
    62
    0
    15
    Hi,

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

    Cheers
     
  6. Scythe

    Scythe Well-Known Member
    43

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

Share This Page

Loading...