File.delete() does not delete symlink on Android?
<p>I can't delete a symlink on Android. Can't with <code>File.delete()</code> and neither with
<code>exec("rm " + verFile.getPath())</code></p>

<p>I have a symlink</p>

<p><code>com.example.app/mydata/12345.ver --&gt; com.example.app/lib/library.so</code></p>

<p>which was created by</p>

<pre><code>Runtime.getRuntime().exec(String.format("ln -s %s %s", target, link));
</code></pre>

<p>After upgrade (download different build.apk from web) I want to delete this link by</p>

<pre><code>File verFile = new File(dataDir, verFile);
Log.w("MyApp", "Deleting file " + verFile.getPath());
if (verFile.exists()) Log.w("MyApp", "File exists!");
try {
    Runtime.getRuntime().exec("rm " + verFile.getPath());
} catch( IOException ioex ) { Log.w("MyApp", "Failed to delete"); }
</code></pre>

<p>I can replace </p>

<pre><code>Runtime.getRuntime().exec("rm " + verFile.getPath());
</code></pre>

<p>with</p>

<pre><code>verFile.delete()
</code></pre>

<p>but it has no effect (the file still won't be deleted).</p>

<p>From the <strong>adb logcat</strong> I can see</p>

<pre><code>W/MyApp   (13298): Deleting file /data/data/com.example.app/mydata/12345.ver
W/MyApp   (13298): File exists!
</code></pre>

<p>But the file 12345.ver is still there! It has the same user/group permissions as the rest of the application (except <code>lib</code> directory which is owned by the <code>system</code> user).</p>

<p>Any clue?</p>
