node-smb2 icon indicating copy to clipboard operation
node-smb2 copied to clipboard

Problem with check file exists or unlink

Open thosankitai1990 opened this issue 7 years ago • 2 comments

Hello I found your smb2 is convenient. But I have a issue with remove file my folder: "dev" my file: "89b775f5-10c2-49d3-8b2c-c76000dad5bc.jpeg" ( existed) I tried to remove file follow:

smb2Client.unlink("dev\\89b775f5-10c2-49d3-8b2c-c76000dad5bc.jpeg", function (err) {
                if (err) {
                    console.log(err);
                    next(err);
                } 
                console.log("file has been deleted");
                return next();
});

But I got a error message: "File does not exists." I used smb2 "exists":

smb2Client.exists(`dev\\89b775f5-10c2-49d3-8b2c-c76000dad5bc.jpeg`, function (err, exists) {
                if (err) {
                    console.log(err);
                    next(err);
                } 
                console.log(exists ? "it's there" : "it's not there!");
                return next();
});

But I got the same message, too. Please help me check it! Thanks for support!!!

thosankitai1990 avatar Dec 03 '18 08:12 thosankitai1990

Hi, Just wanted to know if you got this resolved or any alternative? I'm also facing the same issue. @thosankitai1990 @bchelli

SHAPPY0 avatar Apr 27 '21 08:04 SHAPPY0

I also encountered this problem. Do you know how to fix it

xieerduos avatar Sep 28 '23 08:09 xieerduos