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

move file not work #16

Open
laoyur opened this issue Jun 2, 2018 · 3 comments
Open

move file not work #16

laoyur opened this issue Jun 2, 2018 · 3 comments

Comments

@laoyur
Copy link

laoyur commented Jun 2, 2018

I succeeded in uploading files, but always failed to move file.

Error Domain=smb.error Code=58 "No such file or directory" UserInfo={NSLocalizedDescription=No such file or directory}
@anonymouz4
Copy link

Me too!

@damikdk
Copy link

damikdk commented Aug 27, 2018

Same, guys. smbFile.exist == YES

Maybe the problem is this path parsing?

NSString *smbOldPath = [oldPath stringByReplacingOccurrencesOfString:@"/" withString:@"\\"];
NSString *smbNewPath = [newPath stringByReplacingOccurrencesOfString:@"/" withString:@"\\"];
int res = smb_file_mv(self.server.smbSession, self->_shareID, smbOldPath.UTF8String, smbNewPath.UTF8String);
if (res != 0) {
error = [SMBError notSuchFileOrDirectory];

@damikdk
Copy link

damikdk commented Aug 27, 2018

According this lines, path should be relative to old path? Should I set newPath = ../newPath.txt?

UPD: It's not work for me :(

- (void)moveTo:(nonnull NSString *)path completion:(nullable void (^)(NSError *_Nullable))completion {
SMBFile *f = [SMBFile fileWithPath:path relativeToFile:self];
[self.share moveFile:self.path to:f.path completion:^(SMBFile *_Nullable newFile, NSError * _Nullable error) {

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

3 participants