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

Mkdir not working ? #49

Open
san-slysz opened this issue Jan 21, 2022 · 1 comment
Open

Mkdir not working ? #49

san-slysz opened this issue Jan 21, 2022 · 1 comment

Comments

@san-slysz
Copy link

san-slysz commented Jan 21, 2022

I have been trying to use smb2 to create a new folder on remote.
I am not sure what 'path' is suppose to hold (absolute path on share, relative path to share, ...)

Imagine this

  const smb2Client = new SMB2({
    share:'\\\\ip.ip.ip.ip\\c$\\shareFolder',
    domain:'ME',
    username:'my',
    password:'1234'
  });

Then if I want to create 'plop' under 'shareFolder' what should I wrote?
I tried
smb2Client.mkdir('plop'
smb2Client.mkdir('.\plop'
smb2Client.mkdir('.\\plop'
smb2Client.mkdir('\\\\ip.ip.ip.ip\\c$\\shareFolder\\plop'

None seems to work.
Could you tell me if I'm doing this wrong?

@san-slysz
Copy link
Author

san-slysz commented Jan 21, 2022

Considering an existing hello folder, with a.txt in it

// This works

smb2Client.readFile('hello\\a.txt', function(err, data){
  if(err) throw err;
  console.log(data);
});

// This doesn't

smb2Client.mkdir('hello\\plop', function (err) {
  if(err) throw err;
   console.log('Folder created!');
});

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

No branches or pull requests

1 participant