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 directory support to smbc #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cholcombe973
Copy link

I've never done samba development before so I don't really know if this is correct. I have however done a bunch of filesystem work and these calls are similar. It looked like the codebase took great care to not allocate unnecessary things. If you'd like me to try and do the same I can try and remove String and PathBuf from the directory struct. I'm going to setup a local samba on a virtual machine and give this a test with valgrind to make sure i'm not leaking anything.

@cholcombe973
Copy link
Author

I don't think I caused that failure

@cholcombe973
Copy link
Author

cholcombe973 commented Sep 7, 2018

This code works on my test virtual machine and valgrind shows no leaks. My test code produces:

Ok(DirEntry { path: "..", name: "..", comment: "", file_type: Dir })
Ok(DirEntry { path: ".profile", name: ".profile", comment: "", file_type: File })
Ok(DirEntry { path: ".sudo_as_admin_successful", name: ".sudo_as_admin_successful", comment: "", file_type: File })
Ok(DirEntry { path: ".viminfo", name: ".viminfo", comment: "", file_type: File })
Ok(DirEntry { path: ".bashrc", name: ".bashrc", comment: "", file_type: File })
Ok(DirEntry { path: ".gnupg", name: ".gnupg", comment: "", file_type: Dir })
Ok(DirEntry { path: "hello_rust", name: "hello_rust", comment: "", file_type: File })
Ok(DirEntry { path: ".lesshst", name: ".lesshst", comment: "", file_type: File })
Ok(DirEntry { path: ".bash_logout", name: ".bash_logout", comment: "", file_type: File })
Ok(DirEntry { path: ".ssh", name: ".ssh", comment: "", file_type: Dir })
Ok(DirEntry { path: ".cache", name: ".cache", comment: "", file_type: Dir })

@cholcombe973
Copy link
Author

@grossws any thoughts on this?

@grossws
Copy link
Member

grossws commented Sep 24, 2018

@cholcombe973 I've looked through patch but haven't time to test is yet. Sorry for delay, I'm quite busy with work projects and Apache Tika right now(

@cholcombe973
Copy link
Author

cholcombe973 commented Sep 24, 2018 via email

@deeprobin
Copy link

Now its january

@milgner
Copy link

milgner commented Dec 9, 2021

This looks extremely useful! I was looking into ways to access a SMB share using Rust and unfortunately there aren't many options available. Mounting through the operating system might be a solution but it would make error handling harder.

All in all it looks like this library is still the best solution, but without a way to iterate over directories it's not really useful...
This implementation looks straightforward, nice work! 👍

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.

4 participants