Skip to content
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

Add write back support for unmount option and copy to support for mount option #4

Merged
merged 4 commits into from
Apr 22, 2023

Conversation

psdzzm
Copy link
Contributor

@psdzzm psdzzm commented Mar 7, 2023

Add a -c, --copy-back option for the unmount operation.

Achieved by using cp instead of std::fs::copy, because cargo uses the file timestamps to determine if a file has changed.

@psdzzm
Copy link
Contributor Author

psdzzm commented Mar 7, 2023

Also add copy to ramdisk option for the mount operation, using c, --copy-to option

@psdzzm psdzzm changed the title Add write back support for unmount option Add write back support for unmount option and copy to support for mount option Mar 7, 2023
Copy link
Owner

@PauMAVA PauMAVA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! @psdzzm

First of all sorry for the delay in my response to your PR. I think it's a great addition to this project. I have noted a couple of small fixes about logging. When you fix them I will proceed to run the workflow and merge this into the main branch.

Also, could you add a test case for copy_to and copy_back?

Thanks a lot for your contribution and interest in this project! 😄

src/main.rs Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
@psdzzm
Copy link
Contributor Author

psdzzm commented Apr 22, 2023

Hi @PauMAVA
I'm sorry for not getting back to you sooner. I've resolved the logging problem and added a test for copying to and back.

fn test_copy_back() {

@PauMAVA
Copy link
Owner

PauMAVA commented Apr 22, 2023

Hey!

No problem. Almost there, please run cargo fmt and commit the changes so that the workflow doesn't fail.

Thanks!

@PauMAVA
Copy link
Owner

PauMAVA commented Apr 22, 2023

Everything good!

Thanks a lot for your interest and contribution to cargo-ramdisk @psdzzm 😄

@PauMAVA PauMAVA merged commit 5feb608 into PauMAVA:main Apr 22, 2023
@PauMAVA
Copy link
Owner

PauMAVA commented Apr 22, 2023

Available in crates.io as from 0.2.0.

@psdzzm
Copy link
Contributor Author

psdzzm commented Apr 22, 2023

If possible, you can add the copy to and back option in README. Both mount and remount use -c option for enabling, like cargo ramdisk mount -c.

@PauMAVA
Copy link
Owner

PauMAVA commented Apr 22, 2023

Yep. Just updated the README and also the workflow as the tests were failing sometimes due to test parallelism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants