Permalink
Browse files

Fix create symlink: mkdir the parents directories, #10

  • Loading branch information...
Elbandi committed Apr 15, 2012
1 parent 73100b4 commit d15260998fa38ad650fbbc8cd7437732ea107bd2
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/com/chrulri/droidtv/ChannelsActivity.java
@@ -259,8 +259,9 @@ private void fixPermission(File file) {
private void createSymlink(File target, File symlink) {
try {
- Process p = ProcessUtils.runAsRoot("ln", "-s", target.getAbsolutePath(),
- symlink.getAbsolutePath());
+ Process p = ProcessUtils.runAsRoot(
+ "mkdir", "-p", symlink.getParentFile().getAbsolutePath(), "\n",
+ "ln", "-s", target.getAbsolutePath(), symlink.getAbsolutePath());
p.waitFor();
} catch (Exception e) {
Log.w(TAG, "Failed to create symlink: " + target.getAbsolutePath() + " <- "

1 comment on commit d152609

@chrulri

This comment has been minimized.

Show comment Hide comment
@chrulri

chrulri Apr 17, 2012

nice fix, please send me a pull-request

nice fix, please send me a pull-request

Please sign in to comment.