what is an update list
An update list is a list of all the updated files in a directory. The script will find all the files that have been changed since the last time it ran, and update the list with the new file names. This can be useful to update a list of change comments and diffs, or ftp files to a remote site.
The format of the list is:
For example: foo.pl -m bar -d /tmp/foo bar.pl -d /tmp/bar (Fred Barney 13:34:56 11-Dec-1999)
Note that the original file name is prepended with a dash to remove problems with case sensitivity and spaces.
The -d option means that the diff output is append only. This is useful if you are using the script in combination with a compare tool (e.g. cmp). Or you can use it to force change comments into a comment field of your mail program when you want to send changes to the team mailing list.
how to create and use an update list
You will need a directory of all the files you want to update, and a script that looks at each file and updates the list. Update the list with this command:
This script iterates through the directory and prints out all files and their corresponding path values. It then checks whether each file is updated on your hard drive by comparing the filesize with the one in your update list directory. Finally, it prints out a list of all unchanged files in order to flag articles you may want to update.
You will want to download this script first, before you can use it:
“””This function contains the code to update your list. It does not yet include a way to read the data from an input file.”””
for f in os.listdir(update_list_path):
You may also want to separate these lines with a new line character, and look into creating better variable names that make it easier for you to understand the purpose of each variable. Define these variables before you start writing your code.
benefits of using an update list
Note that the update list only includes file names. To diff file versions, you will need to pipe the list through a diff program. To get the file sizes, you will need to pipe them through a file program. Use git-diff, e.g., if the diff is to be done on a Linux machine:
git-diff -s -M 6 –directory-filter “*/files/|*/files.txt” files |grep -v “^$” | diff3 -V > files.txt
For Windows, use the diff3 program, e.g.:
diff3 -s -M 6 –directory-filter “*/files/|*/files.txt” files | grep -v “^$” | diff3 -V > files.txt
The diff routine will output the file sizes between files of different types in the same way that git-diff does. Note that this is not a true version control system because you’re not tracking any data centrally (only on your local machine(s)).
If you know of a better way to do this, please let me know.
Here is what an updated .git/info/exclude looks like (from commit shrc-6dfeec6 ) after the update:
examples of how to use an update list in your own code
Here are some examples of how you can use an update list in your own code. These are not thorough, since they use different tools. The folder this code is in is “my” and contains one single file named “myfile.c”. This script checks the file to see if any of the lines of it have been changed. It then adds them to a list. This list is stored in the file “mylist.dat”. The script then uses this list to update all of the lines that have been changed.
#!/usr/bin/python # written by ‘ilnemor’ – http://www.no-ip.info # copyright 2008 # if your using source control and want to keep track of file changes, # this is a good way to do it. # I use this to track changes to my C++ files. # this is the code that will check: inputfile = open(“myfile.c”, “r”) updateList =  #this is where the list will be stored in updateList = open(“mylist.dat”, “w”) lastLineChanged = 0 for lineIndex in range (0, inputfile.tell()):
The above code checks the file and stores it in a variable (inputfile). It then creates an empty list (updateList). The code then opens a file ( updateList) and adds it to the list. It then sets the variable “lastLineChanged” to 0.