IMPLEMENTATION OF DOCUMENT UPDATER
Mr. Vishal Jayaswal
*1, Himanshi Gupta
*2, Sakshi
*3, Gourav
*4*1,2,3,4Department of Computer Science and Engineering, Meerut Institute of Engineering and
Technology , Meerut ,U.P., India.
ABSTRACT
Data consistency and data integrity are important for keeping our data safe .To keep our data consistent we are designing a tool that will help us for the same .The main purpose is to make it easy for user to update a file or document with some clicks . Data integrity will be increased as user will update the copies of source file too . It will remove confusion . Many techniques have been proposed for all these tasks but in this paper we will see the approach of solving all these tasks in an efficient way and we will link all these task so that on simple click in the button you can do this task. And this approach will update every replica of original document by just updating original document with one click in a single system as well as in distributed system. All the systems in distributed system should be connected by LAN.
Keywords: Data Consistency, Data Integrity, Update, File.
I. INTRODUCTION
Data is not static as its keep changing and these changes need to be reflected in original files and replica also.
The process that help to do this is known as updating. There are three files that are used while updating a file.
The permanent data file, called the master file contains the most current file data. The transaction file that contains information about changes that need to be applied to the master file. The last and third file that is needed in an update program is known as error report file. The error report file contains a list of all the errors that are discovered during this update process and is presented to the user for further correction.
Most of us are facing a problem i.e If a user make some updation in one file , the same updation will be done in all copies of the same file stored in different drives of the system.
It will maintain the consistency and integrity of data in our system.
Data consistency: It means that there is consistency in the data throughout the dataset. This becomes an issue especially when data is collected from multiple sources. Discrepancies in data meanings between data sources can create inaccurate, unreliable datasets.
Data integrity: It is the assurance of, and the maintenance of, data accuracy and consistency over its entire life- cycle.
So to overcome this problem we have designed a tool that will update every replica of original document by just updating original document with one click.
II. LITERATURE REVIEW
The existing system is a manual system in which the user have to update all the replicas of the File present in the system manually . Manual updation of the file replica is a complex process and the time complexity of this manual process will be very high .Finding the replica of source file inside the drive can cause a big error and some file can be missed if we search manually .With the help of this software a user can update all the replica of source file inside the system by searching them in all drive in a very less time with a single click. The time complexity of this process will be very less as compare to the manual process.
In theory, implementation of document updater can be implemented in any system and this can search and update many number of files in a very less time .
Python is a language that is widely used, general-purpose, and high level in nature. This language was invented by Guido van Rossum in 1991 and then developed by Python Software Foundation. It was designed with an emphasis on code readability, and its syntax allows programmers to express their concepts in fewer lines of code.
Python is a programming language that help you to work quickly and to integrate multiple systems more efficiently.
Python Module
A module is a file that contains Python definitions and statements. A module can define functions, classes, and variables. A runnable code is can also be included in a module. If we Group relatable code into a module then its makes the code much more easier to understand and use. It makes the code more organized.
VARIOUS PYTHON MODULE
OS: OS module in python to access operating system's properties. (copy, remove, paste) There various in OS module which are as Follows:
os.name: The name of the OS dependent module is been imported with this function. There are names that have currently been registered: ‘posix’, ‘nt’, ‘os2’, ‘ce’, ‘java’ and ‘riscos’
os.getcwd():The Current Working Directory(CWD) of the file which is used to run the code is returned with this function . This can change according to the system.
os.error: All functions that are contained in this module raise OS Error in the case of invalid or inaccessible file names and paths, or other arguments that have the correct type, but are not accepted by the operating system.
os.error is an alias for built-in OS Error exception.
os.open(): This method opens a pipe to or from command. The value that is return can be read or written depending on the mode whether it is ‘r’ or ‘w’. The direct changes will be reflected into the file as output for popen().
os.close(): The file that is opened using open(), can only be closed by using close() function. But the file that is opened using os.popen() function, can be closed vai close() function or os.close() function. If we try to close a file that is opened with open() function, using os.close() function, Then Python will a throw TypeError.
sys : System module in python to access files in the hard drive of computer.
Tkinter : Tkinter is the standard GUI library for Python. When Pyhton combined with Tkinter module then its provides a fast and easy way to create GUI based applications. Tkinter module provides a very powerful object-oriented interface to the Tk GUI toolkit.
Socket Programming: The way of connecting two nodes on a network to communicate with each other is known as socket programming. One socket(node) listens on a particular port at an IP, while second socket reaches out to the other to form a connection. Server forms the listener socket while client reaches out to the server.
III. IMPLEMENTATION
First of all user will run the Tool, and he/she will be asked to enter the name of the file to edit. Tool will search for the file in SOURCE location. If file found, File will be opened. And user can edit that file. If file not found, error message will be shown. After editing the file, User will save the file, and that file will be streamed on stream line and redirected to the tool back.
All the LAN connected systems can access that file.
All the files in client systems that need to update that file will be updated in following manner:-
As soon as he comes back, he need to press the button (UPDATE FILES), to update the replicas. Tool will start searching for the file in the DESTINATION systems. If found, it will be added to the list. Final list will be shown to the user from which he can select all or select multiple files he need to update.
Step 1:(importing modules)
Firstly, we will import all the required modules for our project.
import sys #for system properties
import PIL #for accessing images import shutil #for copying files import Ctypes #for screen properties
Step 2: (creating objects & setting screen)
window = Tk() #tkinter object for creating window user32 = ctypes.windll.user32
user32.SetProcessDPIAware()
[w, h] = [user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)]
a = str(lt[0]//2-192) b= str(lt[1]//2-108)
Step 3 :
Creating function to get the source file name , source location and destination drive.
def getFile():
details = {}
details[name] = Entry() details[source] = Entry() details[destination] = entry() return details
Step 4:
Creating Function to find source file from location and opening it for editing.
def opening(name,source):
for files in source:
if name == files:
sys.open(files)
source_path = file.path
return path #full path of file for future updation at destination locations break
else print(“File not found!”)
Step 5:
creating function to update files at destination locations. . . def update(name, destination):
for files in destination:
if name == files:
destination_path = files.path os.remove(files)
shutil.copyfile(source_path, destination_path) break
else print ("File not found!")
IV. RESULT
We have generated an output where all the replica files have updated values as original file.
If the replica of original file is present in the drive then values will get update in the replica otherwise file not found will be printed.
S. No. No. of replicas Time each transaction
1. 2 0.8sec
2. 3 1sec
3. 4 1.3sec
4. 5 1.7sec
5 6 2sec
6. 7 2.4sec
7. 8 2.7sec
V. CONCLUSION
In this project ,work is done to update all the replica with one click while making changes in the original file.
The proposed work focuses on finding the replica of the original file in the drive and updating the values in all the files with single click with accuracy and precision. To do the same work we have used various python modules like os module , sys module , tkinter . With the help of os module we can acess all the properties of operating system. Tkinter provides a fast and easy way to create GUI applications. System module in python to access files in the hard drive of computer. We achieved promising results from proposed methods with high accuracy results.
VI. REFERENCES
[1] Fortier, P.J.; Michel, H.E. Database Systems Performance Analysis. In Computer Systems Performance Evaluation and Prediction; Digital Press; Elsevier Science: Amsterdam, The Netherlands, 2003; pp. 409–
444.
[2] Tosun Umut. Distributed Database Design: A Case Study. Procedia Comp. Sci. 2014, 37, 447–450.
[3] Gao, H.; Duan, Y.; Miao, H.; Yin, Y. An Approach to Data Consistency Checking for the Dynamic Replacement of Service Process. IEEE Access 2017, 5, 11700–11711.