Comments (8)
Not sure if I'll get to coding this, but it can be fixed by replacing the colon in the android folder name with a Modified Letter Colon ꞉
which is fairly similar to a regular colon. Essentially, as @divVerent said, this could be used to encode it both ways while maintaining the look of the colon on android.
from adb-sync.
For others on Windows who want to still be able to copy the files with invalid characters, this is the workaround I currently use.
Replace the dst_name = self.dst[i] + name
line in the PerformCopies
function with: dst_name = self.dst[i] + re.sub(b'[^\w\-_\.\(\) \\/]', b'_', name)
If you merely want the files with invalid names to be ignored, see here to have it just skip over files that have errors (you just add a try-catch in the loop): #29 (comment)
from adb-sync.
It's actually a new restriction when using the FUSE backed emulated storage and the code is in MediaProvider:
public int insertFileIfNecessaryForFuse(@NonNull String path, int uid) {
...
if (!path.equals(getAbsoluteSanitizedPath(path))) {
Log.e(TAG, "File name contains invalid characters");
return OsConstants.EPERM;
}
Since it's a limitation in the system (and to be fair, colon is indeed an invalid character for a FAT file system), I don't think adb-sync
can do anything here.
EDIT:
You can edit PerformCopies
and put in dst_name = self.dst[i] + re.sub(b'["*:<>?\\\\|]', b'_', name)
from adb-sync.
This used to work on Android 10 (for me) and I see absolutely no reason why ":" cannot be a valid character on modern filesystems.
from adb-sync.
I would prefer not introducing any kind of replacing as otherwise syncing back and forth would create duplicates.
If anything we would need either a bijective encoding, or - if activated by a special flag - an injective one (e.g. replacing invalid characters by escapes like =3A for a colon).
from adb-sync.
Just to check, has anyone done a root cause analysis on this? Most Unix filesystems have no problem with colon characters (on Mac, maybe, but that's worked around) so I am intrigued by what is causing this?
Edit: good heavens, there are several possible issues here:
if subprocess.call(
self.adb +
[b'shell', b'mkdir -p %s' % (self.QuoteArgument(path),)]) != 0:
raise OSError('mkdir failed')
from adb-sync.
I'm hit by this as well - and I'm using adb-sync
on Linux. The problem seems to be with the underlying adb
implementation because I can't adb push
files with colon in their names either. This EPERM seems to be a new behavior on Andorid 10 or 11.
from adb-sync.
This is not only caused by colons, but is also by asterisks and double quotes.
from adb-sync.
Related Issues (20)
- error running it. stacktrace. HOT 1
- Hard-coded location of python3 HOT 2
- TypeError with latest rev HOT 1
- Problems with parameters: a bytes-like object is required, not 'str' HOT 3
- adb-sync seems to close standard input? HOT 3
- anyway to --reverse and --delete?
- Problems with encoding: UnicodeDecodeError: 'utf-8' codec can't decode byte: invalid start byte HOT 6
- Is this project still active? HOT 2
- windows 10 HOT 8
- adb-sync doesn't work correctly with symlinks
- Crashes when trying to copy files with question marks in the name.
- Copying from external storage HOT 4
- adb-sync doesn't copy files properly if names are same on local and remote HOT 5
- When the file length is the same, it will be considered as no difference HOT 1
- two way sync breaks when filename contains spaces
- Scanning and diffing takes a long time for large directories HOT 2
- "bad date" from "touch" when using -t option HOT 1
- Ignore unreadable files
- Use my fork HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adb-sync.