2

I have a folder located at E:\My Work\code_library which I plan to store code snippets, etc..

I have a folder located at E:\Server\htdocs\code_library which is my Apache root directory

Is there a way that I can edit files at either location and have them replicate/stay in sync/ or BE the same files?

For organizational purposes, I would like to keep files located at E:\My Work\code_library this folder has a large amount of other folders, all work related, it is easy to copy/transport/keep on a thumb drive/etc... these files as they are all located in a convenient location TOGETHER

I then have to keep files at E:\Server\htdocs\code_library as well so I can access them in my web browser and have PHP and stuff work.

Any ideas?

JasonDavis
  • 5,062

2 Answers2

4

Assuming you are comfortable with the command line, you can make a symbolic link in htdocs that points to E:\My Work\code_library.

Remove/rename the code_library directory in E:\Server\htdocs. Then open a command prompt, and CD to E:\Server\htdocs. Then make your symbolic link:

mklink /d code_library "E:\My Work\code_library"

I should mention that you can do this the other way. That is, leave the Apache folder code_library in place, and make E:\My Work\code_library a symbolic link that points to the Apache copy.

0

I answered a similar question in this SU post. If you are ok with manually triggering the sync operation, SyncToy, a free PowerToy utility from Microsoft, may provide the functionality that you're looking for. From Wikipedia, operations include:

  • Synchronize takes the two folders and makes sure they have exactly the same files. To do this, SyncToy may copy files in either direction and may delete or rename files in either folder. In the case that a file has been updated in both the left and right folders, the version with the later modification date is considered the conflict winner and will overwrite the other version.3
  • Echo looks for changes (file modifications, new files, renames, deletes) in the left folder and makes them in the right folder (one-way sync).
  • Contribute is like an Echo, but it does not delete any files on the right folder that may have been deleted in the left folder.
JW8
  • 1,202
  • 3
  • 13
  • 26