question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FR] add option to merge received directories with local directories

See original GitHub issue

E.g., the remote sends a/ which has two files a/b/1.txt and a/b/2.txt, but we already have the file a/b/d.txt locally. This currently fails because the local directory already exists.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
meejahcommented, Oct 16, 2022

Interesting!

Brian and I have talked a little about something similar for Dilation (e.g. to allow other applications to play around with it w/o having to have a Dilation-supporting library for their language).

Thinking out loud, I wonder if SOCKS5 could be an appropriate interface here? It might be stretching the semantics of that protocol a little, but a new connection opening a new sub-channel in Dilation would be the rough idea.

In any case, the point is I’d be a lot more interested in exploring these (port-forwarding, SOCKS5, …?) as ways to inter-operate with existing applications rather than adding “rsync” features to the Python CLI.

At a high level, the “UX ask” here is reasonable: “synchronize two folders”. I just don’t think that complexity should live in this code-base. (So, that said, if there are good Python libraries for synchronizing files perhaps this could be a use-case for next-generation file transfer … that is, the Dilation-based protocol).

1reaction
meejahcommented, Oct 16, 2022

I agree that “synchronizing folders” isn’t exactly a use-case of magic-wormhole (although that said, it does of course fall under the general umbrella of “send files places”).

@piegamesde is certainly correct that this isn’t as straightforward as it might appear at first. What do you do when a transferred file exists on the target, but is different content? (Among other considerations of course). What if the sender has a directory called a/foo but a/foo exists as a file on the target?

One approach that might be fruitful would be to take some existing synchronization tool (e.g. rsync) and teach it how to use magic-wormhole to set up connections (rather than e.g. ssh as it does currently). I think this would probably be far more straightforward on top of Dilation because two-way communication is typically required to get synchronization correct . I don’t know rsync well enough to know how “pluggable” its transport might be, so this is just a general idea/example.

A key advantage of this would be the potential to re-use the approach for other tools. That is, specifying how to use magic-wormhole as a secure transport. (This may require additional features in magic-wormhole as well as possibly other tools of course). I would personally be a lot more excited to implement it this way instead of creating another rsync-like tool

I’m not aware of any Python implementation of general file-synchronizaiont; if you know of any such libraries please post them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Merging folders with mv? - directory
The -p means to create all intermediate directories, as needed, and not raise an error if the directory already exists. The -v means...
Read more >
How do I merge a sub directory in Git?
I just found this GitHub thread which could be more adapted for merging a whole subdirectory, ... My repository target directory => cookbooks/cassandra....
Read more >
Create a directory of names, addresses, and other ...
Create a directory of names, addresses, and other information ; Select recipients. Go to Mailings ; Insert field codes · Type the text...
Read more >
Merging/Migrating User between User Directories
User Management. · Choose User Directories. · Choose Additional Configuration & Troubleshooting (section) > Migrate users from one directory to another.
Read more >
Specifying the Directories that Contain Merge Modules
InstallShield lets you specify the locations on your local machine, or on a network, where you are storing merge modules (.msm files).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found