-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lack of symlink support #125
Comments
Willing to test on Android/Linux if this is possible for zip4j. |
Looking into it. |
Let me know what you think, I’ve started looking into it myself.
… On 13 Jan 2020, at 19:46, Srikanth Reddy Lingala ***@***.***> wrote:
Looking into it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#125?email_source=notifications&email_token=AAECE7QRTLAGDQBSLU6Y7OLQ5SZJZA5CNFSM4KEEOVC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIZ2ZEI#issuecomment-573811857>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAECE7QKVZ2UUSORMSHEMUTQ5SZJZANCNFSM4KEEOVCQ>.
|
At the moment, zip4j adds the linked file and not the link itself. I presume this is desired behaviour? Your expectation is that the link is added and not the linked file? |
My expectation is that the linked file and the symlink would be created. Symlinks should be preserved generally, if desired
… On 18 Jan 2020, at 12:53, Srikanth Reddy Lingala ***@***.***> wrote:
At the moment, zip4j adds the linked file and not the link itself. I presume this is desired behaviour? Your expectation is that the link is added and not the linked file?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
It should be optional. Some users would want to copy the actual referenced file instead of the link, which zip4j currently does by default. However, copying symlinks as-is is important too. Perhaps, you can add a boolean flag in Man page here for linux zip command for context: https://linux.die.net/man/1/zip. Check out the -y or --symlinks option. |
I agree with providing an option to the user. I will include an enum in I am investigating the possibilities and different scenarios. What I am currently stuck with and investigating is that FileInputStream.read(link) seems to only read the linked file and not the link. If user chooses the option to include link, then we will be needing a way to read the content of the link file. I am currently looking into this, hopefully there is an easy way around this. I need to also investigate into adding appropriate headers (if any). |
Great options. Thanks for considering this feature.
Ya, I'm not sure if you can do this without This will also mean that the new options would require atleast Java 7, Android Oreo. |
|
I added this feature in zip4j. As discussed above, you have three options, to only include link, to only include target (linked file) and to include both link and linked file. You can set this via I made a SNAPSHOT release P.S: If you have trouble accessing this SNAPSHOT version, you might want to have a look here |
Feature included in v2.4.0 released today |
Sorry for the late response here Srikant. I tested the update and yes it works as intended. Some notes below. Unfortunately, there is a huge roadblock on Android's user visible storage (one that goes Symbolic links, however, are allowed in the private app directories obtained from |
@dknchris Thanks for testing this, and for the hints. I am sure, some of the Android developers will find your hints useful. |
When zipping certain file types like .frameworks on macOS zip4j does not support adding the symlink to the current version of the library.
The text was updated successfully, but these errors were encountered: