justdan0227
justdan0227

Reputation: 1362

Android ParcelFileDescriptor to path string

If I have a ParcelFileDescriptor that is being passed to me and I need to call an API that requires a filePathString, I don't see how to map this? Short of creating a temp file and then passing that as a path is there a cleaner way of doing this?

Upvotes: 1

Views: 1494

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007266

Nope, you're on the right track. Create a temp file and copy the data into it. That's as clean as it gets.

Bear in mind that, despite the name, a ParcelFileDescriptor may have nothing to do with an actual file on the filesystem, let alone one that you have direct filesystem access to.

Upvotes: 3

Related Questions