-
Notifications
You must be signed in to change notification settings - Fork 74
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
How to preserve date created, date modified date accessed of folders? #56
Comments
Just noticed this now – seems to be the same issue I have in #59 just the other way around (you ask about "from device" aka |
Omg last time i posted was april last year !!!! it took so long for a reply i gave up. Is it even possible anymore ? |
I cannot tell (I maybe can read a little C++ but certainly not write). @spion is still active (though maybe on different projects), so I hope the details on my issue plus the fact yours existing as well and even for a year now, most likely being fixed by whatever fixes the other one (thus killing 2 issues with 1 patch) might trigger him to give this project some love again. |
is he even developing the software ?? |
I've been thinking about switching this project to Rust, as I'm not very good at writing safe C++ code (in fact, I'm quite slow at writing C++ in general, which has made it very difficult to find the time to work on it). One idea to help this move further is to try |
What is rust ? is this related somehow to adbfs ? |
Another note: it seems like fuse has moved on - we now have fuse3, which is what most distros use. I tried porting over some of the changes that maz-1 did to get it to work on fuse3 (https://github.com/maz-1/adbfs-rootless) but AFAICT the timestamps appear to be completely lost. |
Rust is a programming language (i.e. I'd like to rewrite this project in Rust) Its somewhat of an upfront cost but after that development should be much more of a breeze. |
Ah, and there's a difference indeed:
Log
Looks like it pushes it multiple times, and in between also pulls it (I actually copied it twice as the first time I had no output, using the same session in a Midnight Commander window – but I definitely did not pull it, I just removed it in between). And finally, the last command is resolving the riddle:
WHY? It's not the way The only mention of static int adb_utimens(const char *path, const struct timespec ts[2]) {
string path_string;
path_string.assign(path);
fileData[path_string].timestamp = fileData[path_string].timestamp + 50;
shell_escape_path(path_string);
queue<string> output;
string command = "touch '";
command.append(path_string);
command.append("'");
cout << command<<"\n";
adb_shell(command);
// If we forgot to mount -o rescan then we can remount and touch to trigger the scan.
if (adbfs_conf.rescan) adb_rescan_file(path_string);
return 0;
} Where is it passed? It's calculated by |
PS: While I understand a rewrite in Rust, that's not installed on my machine with the default build tools. Checked with my package manager, no idea what packages I'd need for that – but it would be quite an extra for non-devs. Would you then provide binaries? As for "timestamps lost" – maybe there could be an option turning |
Okay so in comparison from what I understand, in NTFS windows, if you have a parent older with subfolders,changing anything inside the subfolders changes the date modified and date accessed but leaves the parent folder timestamps alone. If somehow, this could be tweaked with android to replicate the same behaviour for subfolders then we have a soution where the date and time won't change if you make changes within a subfodler. Mind you a few notes-- this COULD only works for parent folders not subfolders. Any considerations of my idea? |
I pushed an update to feat/merge-libfuse-3 as it looks like @maz-1 has done an incredible job at fixing some of these issues by passing the times to the https://github.com/spion/adbfs-rootless/tree/feat/merge-libfuse-3 is the new code - note that there is a slight change in the readme too, as this has been upgraded for fuse3 rather than fuse. |
so all timestamps are preserved ? |
Gave it my best shot to test the end result, to the extent of my knowledge it looks OK. But please give it a try yourself. I could have missed something. (try the branch) |
Would it be okay if you could provide a screenshot as a test ? |
@spion that Readme needs another update I'm afraid:
And now, if I want to
However, for existing scripts using e.g.
and point out the above (e.g. "Note that you cannot do so if you use… In that case…"). Not sure what should be done "in that case", e.g. when ntfs-3g is being used. Preserve current master as branch? OK, I dared doing it. But timestamps are
… Oh. And a few seconds later that is reflected – so it just takes a little, and Midnight Commander was too fast. To reproduce: this time I used 2 terminal windows, let's call them T1 and T2. In T2 I use Midnight commander.
So it seems like this would solve #59 then. I certainly could have been less verbose (simply stating the That said, maybe have the Readme mention the delay for proper timestamps? I'll meanwhile replace my working |
Strange, on Ubuntu I got the exact same opposite message, as everything there seems to depend on fuse3. As far as I could tell, fuse3 has been the preferred way to go since ~2016-2017 Perhaps installing libfuse3-3 and libfuse3-dev should be enough to compile the new version without causing disruption ? |
For compiling yes, but if you want to use I also had to (at least temporarily) switch back to Btw: I'm on Linux Mint 20.3, which is not the very latest; it's still based on Ubuntu 20.04, which could explain the difference. |
You should be able to use |
Please look again, Gorgi: I'm not able to MOUNT. It complains on sudo ln -s /usr/bin/fusermount /usr/local/bin/fusermount3 (actually, I rather linked it into PS: my test results might be tainted then, though. If something does not work as expected, the cause could be the wrong PPS: that said, timestamps work the same as described above (i.e. with a slight delay). |
Sorry, I might make a few mistakes and miss a point or two! 😀 but I try not to make claims when I'm unsure (just ask questions). Ok. I will need some time to figure out the fuse/fuse3 dichotomy in terms of code (does it bring anything new to the table. I think it may be possible to backport the fix without upgrading to fuse3, but to test all that I'll either need to make a mess out of my system or prepare some docker containers with various versions of libraries + adb + android emulator 😅 |
Funny enough in rust land fuser (https://github.com/cberner/fuser/#linux) is compatible with both fuse and fuse3, whatever you have on your system 😀 I already have a hello-world (non-ADB) filesystem working locally and had absolutely no trouble building it with rustup (I understand though that installing something like rustup brings a great difference in comfort for many situations... sigh) |
Yeah, I think it's rather an "error" (not sure if "bug" is to harsh here) on libfuse3's end. For now, I've set the latest build (fuse3 based) back active, with the symlink in place, and will keep on testing whenever I find something suitable. Until now I just successfully mounted an Android-10 device (Wileyfox Swift with LOS), for the last of the above experiments. From that I assume Android 10+ should work with it – give me a sec… Nope. My Android-11 device (FP2 running LOS) does not mount, but I get no useful information via
With the fuse3 build not working on half of my devices, I can give that one some test runs as well. For "critical work" and can always switch back to the last "stable" build – I simply do a |
Hi @IzzySoft - I decided to go the docker + tests route and to try and keep fuse to version 1, at least for now. To that end I opened a PR where suggestions for the kind of tests would be helpful #62 Lets add some good timestamp tests, as well as brainstorm on some tools that we'd like to ensure continue to work (so long as they don't take too long). I would very much welcome input from prolific users 😀 |
I gladly assist with testing new versions – but I have neither docker nor podman set up here (planned for years to take a look at but never found time). Some things I'd have in mind, apart from "basic timestamp checks": For automation, it might be considerable to integrate my adbsync which lets you easily define a bunch of sync pairs in JSON, grouped by devices, and toggle sync pairs or entire devices ("sync groups") on and off with a single 0=>1=>0. Sync pairs can be from or to device, or even bidirectional (experimental, but that shouldn't be a deal-breaker here). |
So when can we begin with the testing phase?
|
Just stumbled upon this issue again when backtracing why I was using |
Its due to lack of automatic tests, mainly. The tests PR I wrote works locally, its just that GitHub doesn't support the virtualization necessary to run android emulator tests in their free runners. I've been watching the issue from time to time and while they did add virtualization to paid runners, there is nothing for free ones yet. I'd really like it for GH to enable this feature. Running a test matrix of multiple android versions locally is painful and it would be much nicer if these could automatically run for other people's PR contributions too. But since its not happening I can try and revisit this if I find some time in the following period. |
How do I preserve using this method of folder date created, date modified, date accessed of android phone when it is connected to my PC? I want to copy folders inside android to PC preserving all these dates exactly
The text was updated successfully, but these errors were encountered: