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

Issue when copying a folder from one share folder to another. #860

Open
fiasko131 opened this issue Feb 3, 2025 · 0 comments
Open

Issue when copying a folder from one share folder to another. #860

fiasko131 opened this issue Feb 3, 2025 · 0 comments

Comments

@fiasko131
Copy link

I have three shared folders on a Windows 11 PC:

Users
Downloads
Pictures

When I copy files from Pictures to Downloads, the code runs normally.

When I copy folders from Pictures to Downloads (in this case juju), I get an error:

com.hierynomus.mssmb2.SMBApiException: STATUS_OBJECT_NAME_NOT_FOUND (0xc0000034): Create failed for \192.168.86.28\Pictures\juju
at com.hierynomus.smbj.share.Share.receive(Share.java:380)
at com.hierynomus.smbj.share.Share.sendReceive(Share.java:359)
at com.hierynomus.smbj.share.Share.createFile(Share.java:156)
at com.hierynomus.smbj.share.DiskShare.createFileAndResolve(DiskShare.java:75)
at com.hierynomus.smbj.share.DiskShare.access$100(DiskShare.java:55)
at com.hierynomus.smbj.share.DiskShare$2.apply(DiskShare.java:109)
at com.hierynomus.smbj.share.DiskShare$2.apply(DiskShare.java:105)
at com.hierynomus.smbj.paths.PathResolver$1.resolve(PathResolver.java:32)
at com.hierynomus.smbj.paths.SymlinkPathResolver.resolve(SymlinkPathResolver.java:62)
at com.hierynomus.smbj.share.DiskShare.resolveAndCreateFile(DiskShare.java:105)
at com.hierynomus.smbj.share.DiskShare.open(DiskShare.java:65)
at com.hierynomus.smbj.share.DiskShare.openDirectory(DiskShare.java:151)
at com.hierynomus.smbj.share.DiskShare.list(DiskShare.java:258)
at com.hierynomus.smbj.share.DiskShare.list(DiskShare.java:231)

For this part of the code, folderExists(src) always returns false.

Log.d("copyInSameSmb2","diskShare "+diskShare+" src "+src);
            if (diskShare.folderExists(src)){ <----return always false !
                Log.d("copyInSameSmb2","folder exists");
                String dest;
                if (destDir.equals("") ){
                    dest = name;
                }else dest = destDir+"\\"+name;
                if (diskShare.folderExists(dest)) {
                    DiskShare diskShare;
                    if (smbItemSrc.getShared().equals(serviceOperationsHelper.mCurrentSmb2Share)){
                        diskShare = this.diskShare;
                    }else {
                        diskShare = serviceOperationsHelper.diskShare;
                    }
                    diskShare.mkdir(dest);
                }
                for (FileIdBothDirectoryInformation f : diskShare.list(src)) { <-- if i hard coded  folderExists() to  true STATUS_OBJECT_NAME_NOT_FOUND
                    String filename = f.getFileName();
                    if (".".equals(filename) || "..".equals(filename)) {
                        continue;
                    }
                    String src1 = src+"\\"+filename;
                    copySmb2InMachine(smbItemSrc,src1,dest,isDir, iFo, cut);
                }
            }

When copying a file or folder from Users to Pictures or Downloads, the code runs normally.

When copying a file or folder from Pictures or Downloads to Users, the code runs normally.

In summary, the problem only appears when copying a folder from Pictures to Downloads or vice versa.

It should be noted that Downloads and Pictures are child directories of Users.

I can't detect the problem, what about you?

Thanks?

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