Doing Shell Homework, Ghostwriting, Unix, Linux Homework, Ghostwriting Foreign Shell Homework


This project is to create a file synchronizer .
1.1 Introduction
Many computer users wish to access their files from different machines, and the most convenient way is to use a single file system that is mounted across multiple machines on a network. When the machines are on different networks, the files shared by the system cannot be easily used. For example, a user who has the same files on two machines (portable and desktop), when a file is changed on a portable machine that is not connected to the network at the time, it must manually The new version is copied to the system (this system only contains the old version of the file), when the file is changed in the two systems separately, this operation can be complicated and can produce many errors.
File synchronization software is a way to automatically generate two identical file trees to produce results that match the user's expectations as much as possible. The goal of this project is to write such a software.
1.2
The purpose of a functional synchronizer is to get as close as possible to a state where tree a and tree b are identical, i.e. if the file is A of p (denoted as p/A) then there is a B of p (denoted as p/b) also exists and is the same ( data and metadata) and vice versa. We mean the type of metadata, the permissions of file p, the size of file p, and the last modification date of file p.
In general, if a file has been modified on both sides, it cannot be fully in sync, and we would say there is a conflict between the two versions of the file. The file synchronizer handles two file trees, we'll call A and B, and a log containing the last successful sync for that file, stored in $home/.synchro , containing path A and path B; additionally, for each A file p/A = p/B , which has been synchronized without conflicts, the log file contains its path, its file type and permissions, the size of p and the date of last modification.
We say that when the log file has an entry for p, and the file p/A (or p/B) has the same mode, size and last modified date (those stored in the log), then the file p/A (or p/B) /B) is log compliant

1.3 Simple Sync
The synchronizer runs two trees A and B in parallel, for all p-files it does the following:
- If p/A is a directory and p/B is a normal file, then there is a conflict.
- Otherwise, if both p/A and p/B are directories, it descends recursively.
- Otherwise, if p/A and p/B are two normal files and have the same mode, size, and modification date, then the sync is successful and nothing needs to be done.
- else, if p/A is consistent with log file and p/B is inconsistent with log file, the latter has changed, need to copy all information of p/B to p/A, on the
contrary, if p/B and log file If the file is consistent and p/A is inconsistent with the log file, copy all the information of p/A to p/B.
- Finally, if both p/A and p/B are normal files, and neither of them matches the log file (maybe because the log file has no entry for p, maybe because it doesn't match the metadata of the two files) Then there is conflict.
The synchronizer then overwrites the log file with data from all successfully synced normal files.
It is necessary to note that the order of files in these two trees is not necessarily the same. A may contain files p and q, and B may contain files q and p. It is up to you to decide how to handle conflicts. We can show the conflict list only once. We can ask the user to make a choice, and if the files are text files, we can show the difference between the two files (for example, using the command diff)

1.4 Synchronizer with content comparison
If a file has the same modifications on both sides, the synchronizer above will have a misleading conflict. When there is a conflict between two normal files, the synchronizer that includes the content comparison goes a little further and compares the contents of the two files to see if they really conflict.
- If the metadata of the two files is also the same, then nothing to do, the synchronization is successful;
- If the metadata of one of the two files is the same as the one stored in the log, then the metadata of the other file has changed , then just change the metadata of the first file and the sync is successful.
- Two files are conflicting if their metadata is different, but only in the metadata. They may be useful, but the user needs to be aware of it; of
course, in the case of either of the above sync successes, the results need to be stored in a log file.

2. Extensions
related to extensions are all welcome. For example, we can imagine that managing symlinks (the user can dereference or sync the link itself)
UI is up to you. In particular, when conflicts occur, we can consider implementing a user-friendly interface. For example, propose whether to start the tool that calculates the difference. (txt file) We can also think about how to handle a possible crisis situation: tree A and tree B change during synchronization.
3. Details
To simplify the implementation of this project, the synchronizer will only be developed to perform synchronization of 2 file systems of the same machine.
http://www.6daixie.com/contents/21/1332.html

Our field of direction: window programming, numerical algorithm, AI, artificial intelligence, financial statistics, econometric analysis, big data, network programming, WEB programming, communication programming, game programming, multimedia linux, plug-in programming program, API, image processing, embedded/MCU database programming, console process and thread, network security, assembly language hardware Programming software design engineering standards and regulations. The ghostwriting and ghostwriting programming languages ​​or tools include but are not limited to the following:

C/C++/C# ghostwriting

Java ghostwriting

IT ghostwriting

Python ghostwriting

Tutored programming assignments

Matlab ghostwriting

Haskell ghostwriting

Processing ghostwriting

Building a Linux environment

Rust ghostwriting

Data Structure Assginment

MIPS ghostwriting

Machine Learning homework ghostwriting

Oracle/SQL/PostgreSQL/Pig database ghostwriting/doing/coaching

web development, website development, website work

ASP.NET website development

Finance Insurance Statistics Statistics, Regression, Iteration

Prolog ghostwriting

Computer Computational method

 

Because professional, so trustworthy. If necessary, please add QQ: 99515681 or email: [email protected]

WeChat: codinghelp

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325023681&siteId=291194637