Skip to content

Add directory support to smbc - #1

Open
cholcombe973 wants to merge 1 commit into
smbc-rs:masterfrom
cholcombe973:dir_support
Open

Add directory support to smbc#1
cholcombe973 wants to merge 1 commit into
smbc-rs:masterfrom
cholcombe973:dir_support

Conversation

@cholcombe973

Copy link
Copy Markdown

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
Copy Markdown
Author

I don't think I caused that failure

@cholcombe973

cholcombe973 commented Sep 7, 2018

Copy link
Copy Markdown
Author

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
Copy Markdown
Author

@grossws any thoughts on this?

@grossws

grossws commented Sep 24, 2018

Copy link
Copy Markdown
Member

@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

cholcombe973 commented Sep 24, 2018 via email

Copy link
Copy Markdown
Author

@deeprobin

Copy link
Copy Markdown

Now its january

@milgner

milgner commented Dec 9, 2021

Copy link
Copy Markdown

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