zip-rs / zip-old

Zip implementation in Rust
MIT License
731 stars 204 forks source link

Improve documentation of add_directory #323

Closed Plecra closed 1 year ago

Plecra commented 2 years ago

Discussed in https://github.com/zip-rs/zip/discussions/313

Originally posted by **msdapptech** May 31, 2022 Hello zip-rs team, I would like to ask for some clarification on the documentation regarding `ZipWriter.add_directory()` According to the documentation, it says once you call the method, you can no longer write data to the file. However, from the `write_sample.rs` example, it is clear that you can still add data to the writer. I found this confusing. As how I understand it, the "can't write data to the file afterward" means that the specific path passed into `add_directory` as the argument can no longer be used as the name argument for the `start_file`. Is this correct? If it is, I think there might be better way of phrasing it, telling the user that you can still edit more, it is just that the path will forever be treated as a directory, and cannot be used as a file. Thank you ahead of time, and your library has been helpful.