Coder Social home page Coder Social logo

Comments (12)

vlog-yamamoto avatar vlog-yamamoto commented on August 21, 2024

When listFiles function do after the createDirectory, sometimes listFiles is not 0.

UsbFile currentUsbFile = getRootDirectory();

UsbFile usbFile = currentUsbFile.createDirectory(name);

UsbFile[] usbFiles = nextUsbFile.listFiles();
if (usbFiles != null && usbFiles.length > 0) {
        Timber.e("createDirectory: usbfile[%d]", usbFiles.length);
}

from libaums.

magnusja avatar magnusja commented on August 21, 2024

Hey,

thanks for reporting. Currently I am pretty busy, thus I cannot say when I can have a look at this.

from libaums.

vlog-yamamoto avatar vlog-yamamoto commented on August 21, 2024

I tried the following in the Mac PC and Windows PC.

  1. USB device attach to PC
  2. USB device detach from PC use eject function.
  3. USB device attach to Android
  4. createDirectory function do.

When attach to Mac PC createDirectory function sometimes create that cannot be deleted.
But When attach to Windows PC createDirectory function did not create that cannot be deleted.

It might have occurred from usb storage mount to mac pc.

from libaums.

vlog-yamamoto avatar vlog-yamamoto commented on August 21, 2024

It is seem that FatDirectory class createDirectory function read dirty memory.

createDirectory function result.entries.size() is two. result.entries is "." and "..".
But sometime result.entries.size() over 2 after result.write().
write() is init() at first.

    private void init() throws IOException {
        if (chain == null) {
            chain = new ClusterChain(entry.getStartCluster(), blockDevice, fat, bootSector);
            readEntries();
        }
    }

Is is createDirectory function's "result" is chain = null, So readEntries do.
I thinkk that When readEntries read dirty memory, volume label Log or addEntry is happend.

from libaums.

magnusja avatar magnusja commented on August 21, 2024

Should be fixed in current develop, please review and reopen this issue if not.

from libaums.

vlog-yamamoto avatar vlog-yamamoto commented on August 21, 2024

createDirectory function only do in root directory.

1.USB device attach to mac
2.USB device detach from mac use eject function.
3.USB device attach to Android
4.createDirectory function do in root directory (ex [root directory]/a)
5.USB device detach from Android
6.USB device attach to mac
7.ls command do.

The following problems are occurring often.

No.1 not find "." and ".." file.

$ ls -la /Volumes/USBSTORAGE/a/

No.2 create file.

$ ls -la /Volumes/USBSTORAGE/b/
ls: BF0541E4.-06: Input/output error
ls: E8DC␀␀␀␀.␀␀␀: No such file or directory

No.3 ".." time is error.

$ ls -la /Volumes/USBSTORAGE/h/ 
total 64
drwxrwxrwx  1 yamamoto  staff  16384  3 22 20:12 .
drwxrwxrwx@ 1 yamamoto  staff  16384  1  1  1970 ..

When createDirectory function do in not root directory , It seems not to occur
ex. [root directory]/a/b seems not to occur.
[root directory]/a is occur.

After createDirectory function do, It click createDirectory.
When show createDirectory, It seems not to occur No.1 and No2.

from libaums.

magnusja avatar magnusja commented on August 21, 2024

Can you reproduce this behaviour with the example app included in the repository?

from libaums.

vlog-yamamoto avatar vlog-yamamoto commented on August 21, 2024

I use Usbfileman at developer brunch.
When only createDirectory do in root directory, problems are occurring often.

My application is copy file after createDirectory function.
It seems not to occur after #18.

from libaums.

magnusja avatar magnusja commented on August 21, 2024

Okay I can reproduce No. 3 now.

For the others did you try a different Android device and did you ensure waiting enough time after detaching from the Android device (so data was actually written completely)?

from libaums.

vlog-yamamoto avatar vlog-yamamoto commented on August 21, 2024

I was testing with Nexus5.
When I change device to Nexus6, problems are occurring.

When I change UsbMassStorage, I can reproduce only No.3.
The cause of No.1 and No.2 may be USB storage.

from libaums.

magnusja avatar magnusja commented on August 21, 2024

Okay I currently do not know why no. 3 is happening, but I will have a look asap.

Which of the flash drives is making problems? (iXpand Flash Drive 32GB or SanDisk Ultra USB 3.0 16GB?)

from libaums.

vlog-yamamoto avatar vlog-yamamoto commented on August 21, 2024

iXpand Flash Drive 32GB is making problems.

from libaums.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.