0

The version of eclipse I am using analyzes the .o files that occur in the compilation stage and analyzes which files have been updated prior to compiling, so as to shorten compile time to only what needs an update. For the sake of change management, is there a way I can capture this list of updated files?

I want to ::

  1. Capture the list.
  2. Go through the files one by one and copy the changes to a "backup" folder.
  3. Create a script that will allow me to "revert" changes and then let me know what files were changed.

This way if a mistake is made, I can go back to a working version and start over as necessary, or perform debugging on the code. I think I can do part 2 and 3, I am just needing help with part 1

Edit 1: April 2, 2019 : Regarding GIT : I will try this, but it appears I may have to wait to get approval from my company in order to install it on my system. Furthermore, I want to ensure that such functionality is available for others in my company (on a local basis), even if they may not have Git installed (because for whatever reason it is not standard)

As such, I have found 3 possible options :

1) forfiles : Has an option that allows you to find all files modified after a certain date. Can be coupled with a copy command to copy each individual file over to a desired folder. Con : Only uses date, I found no such references that use Time as a filter mechanism to establish changes after a certain time.

2) Get-ChildItem : can be filtered to only find files changed after a certain time. The output can be sent to a folder, where the files and filepaths can be parsed into a csv file, which can be easily used to establish what files in what paths were updated and then downgrade those files later on. This same list can also be used to establish what files need to be copied over

3) XCopy : Can find all files modified after a certain date using the /d [:MM-DD-YYYY] modifier, but I do not see a time option available, which would mean I would have to then go through the files copied over and delete any modified before the desired time, keeping only those modified after. *source for info :: Find files on Windows modified after a given date using the command line

At this time, of the 3 options listed, Get-ChildItem may be the best option. Will update more when I have decided on an option

  • 6
    This is exactly the kind of thing that source code management systems like Git are for. No need to reinvent the wheel here. – Lee Daniel Crocker Apr 01 '19 at 20:50
  • Have a look at [git](https://git-scm.com/). It has all the features that you want and much more. Otherwise you can consider using a makefile and giving a rule that will copy files for you. – Alain Merigot Apr 01 '19 at 20:50
  • I would normally use git for change management, but in this case I want the software to "backup" on each compilation locally on my computer. The .mk file rule seems like a solid approach, but I am unfamiliar with how to properly write a .mk file to achieve the desired effect. What resources exist for me to teach myself how to do that? – mangoesForLife Apr 01 '19 at 20:53
  • One can have a local Git repository and just not a remote quite easily. – Neil Apr 01 '19 at 22:11

1 Answers1

0

checkout the os.stat package, where you have st_mtime, to check when a file was changed last time. but you have to manage storing the last changes, and do your backup, when they change. If you are lazy, I there is something, relatively solid on Pypy called watchdog.

ramin
  • 928
  • 8
  • 12