Skip to content

How to detect symbolic link and permissions in RemoteFile #155

@jpage4500

Description

@jpage4500

Hi @vidstige,

First off - thanks for this library! It's a huge improvement for me over calling 'adb' from my app in bash scripts.

I wanted to write a simple file explorer with this library and had a couple of questions:

  1. Is there a way to detect a folder link / alias? For example /sdcard on my device is a symbolic link to another folder. But, RemoteFile.isDirectory() returns false.

I imagine there's a way to detect this using the mode but I haven't figured out exactly just yet. Any thoughts?

lrw-r--r--   1 root   root         21 2008-12-31 10:00 sdcard -> /storage/self/primary
    public boolean isDirectory() {
        return (mode & (1 << 14)) == (1 << 14);
    }
  1. Is there a way to detect if a folder is read-only and can't be listed? Or, alternatively if I try to view a folder that doesn't exist I just get back 0 results -- same as an empty folder. I'm looking for some way to know that this isn't a valid folder or isn't one that the user has permission to view (JadbDevice.list())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions