Our current working example allows our device to mount to a PC and show up as a flash drive. We can then press a button and it will disconnect MSD and we can process the files that were copied to it. What if we didn’t want to disconnect? Is it possible at all to work with the files on flash when mounted as MSD or does that process have exclusive and complete control of the files?
It is very difficult to allow for 2 systems to access the same media simoltaiously. This is not currently supported.
Thanks. That’s what I assumed but figured I’d ask anyway.
I would guess it never will be. There’s no way to guarantee consistency of the filesystem when two different systems are writing at the same time, or when one is writing and the other is reading.
This is why, when you put your Android phone in mass-storage mode, that you can’t access the files from the device itself. This is why MTP is preferred, because MTP works at a higher level (more like a shared folder on a network), allowing the device to continue to manage the filesystem in one place.
I guess file servers don’t really work?
In the fileserver, there’s one system managing the filesystem (the server), and the other systems use a higher-level protocol to access the filesystem in a consistent way (NFS, SMB, FTP, whatever).
If you “share” storage over iSCSI, for example, you can’t have two different systems access it at the same time. That’s because the iSCSI protocol is at the block level (i.e. just a big pile of bits) and not at the filesystem level (i.e. “open a file, write data, close file”).