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

Delete files dead #4

Open
aliujb opened this issue Sep 8, 2020 · 0 comments
Open

Delete files dead #4

aliujb opened this issue Sep 8, 2020 · 0 comments

Comments

@aliujb
Copy link

aliujb commented Sep 8, 2020

When a file is deleted and then added, a zombie situation occurs,don't know why?
The code is as follows:

public void addFile(File file, String mtpPath) throws FileNotFoundException, IOException, COMException {
    deleteFile(file.getName(), mtpPath);
    String lastpartofpath = mtpPath.substring(mtpPath.lastIndexOf("\\") + 1);
    PortableDeviceStorageObject storage = getStorage();
    PortableDeviceFolderObject folder = MTPUtil.createFolder(mtpPath, storage, null, lastpartofpath);
    PortableDeviceAudioObject object = folder.addAudioObject(file, "--", "--", new BigInteger("0"));
    //LogUtil.debugPrint(LogUtil.LOG_LEVEL_LESS, this.getClass().getSimpleName(), "Copied " + file.getAbsolutePath() + " to " + mtpPath
    //		+ " on " + getDevice().getModel());
}

The zombie code is 212 lines in the PortableDeviceImplWin32 class :

PortableDeviceContentImplWin32 content = this.getDeviceContent();

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