tag:blogger.com,1999:blog-38498037586574689382024-03-05T19:37:06.571+01:00Ferdinand Prantl's BlogSoftware development, Livelink, SharePoint, JavaScriptFerdinand Prantlhttp://www.blogger.com/profile/13961075422482202277noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-3849803758657468938.post-86479288126228089232019-04-26T09:01:00.001+02:002019-04-26T09:01:07.423+02:00Microsoft Visual Studio Code phones home<p>I have used VS Code since it was released, but I cannot remember seeing an information or getting a question about collecting my usage data for behavioural analysis. Whatever honest might be the intentions, a poor execution will ruin the trust of the developer in their software vendor. You should not have to worry about your tools spying on you.</p>
<p>The team behind VS Code has tried to address the transparency problem, but it appears, that people at Microsoft do not understand well, what "opt-in" means and how to make clear, what information is being collected and sent back.</p>
<p>You can disable the telemetry performed by VS Code by entering these entries in your user settings:</p>
<pre>
{
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false
}
</pre>
See <a href="https://www.reddit.com/r/privacy/comments/80d8wu/just_realised_that_visual_studio_code_sends/">one of the posts about it</a> and the <a href="https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting">official documentation</a>.
<p>The current behaviour is <a href="https://github.com/Microsoft/vscode/issues/47284">most likely not compliant with GDPR in EU</a>. There is no clear way to contact the data controller and to find out who are data processors. You would have to open an issue at GitHub about it.</p>
<p><a href="https://github.com/Microsoft/vscode/issues/8688">Collected data identify your machine my MAC address</a>, which leads to <a href="https://www.gdpreu.org/the-regulation/key-concepts/personal-data/">personal identification</a>, when completed with other parts. If you want leave telemetry enabled, you should better analyse all collected content.</p>
<p>It is not obvious, what are the collected data. You can <a href="https://github.com/Microsoft/vscode/issues/54001">enable verbose logging and study traces</a> in <code>telemetryService.publicLog</code>.</p>
<p>If you want to use VS Code without MS branding, without the telemetry and released under a FOSS (MIT) license, there is a project to provide automated builds of installation packages - <a href="https://github.com/VSCodium/vscodium">VS Codium</a>.</p>
<p>If you want toi switch to VS Codium from VS Code you can use an <a href="https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync">extension to transfer user settings among multiple installations of VS Code</a>. It can be useful for VS Code users too.
Ferdinand Prantlhttp://www.blogger.com/profile/13961075422482202277noreply@blogger.com0tag:blogger.com,1999:blog-3849803758657468938.post-55271086868649391782012-07-08T14:16:00.000+02:002012-07-10T15:51:34.475+02:00OScript syntax highlighting in pure JavaScript<script type="text/javascript">
(function(){
function loadCss(d){for(var b=document.getElementsByTagName("head")[0],c=b.getElementsByTagName("link"),e=0;e<c.length;++e)if(0<=c[e].href.indexOf(d))return;c=document.createElement("link");c.rel="stylesheet";c.type="text/css";c.href=d;b.appendChild(c)}
function loadJs(d,b){for(var c=document.getElementsByTagName("head")[0],e=c.getElementsByTagName("script"),a,f=0;f<e.length;++f){var g=e[f];if(0<=g.src.indexOf(d)){a=g;break}}if(!a)a=document.createElement("script"),a.type="text/javascript";if(b)if(a.readyState)if("loaded"==a.readyState||"complete"==a.readyState)b();else{var h=a.onreadystatechange;a.onreadystatechange=function(){("loaded"==a.readyState||"complete"==a.readyState)&&b();h&&h()}}else if(a.getAttribute("data-loaded"))b();else{a.async=
!1;var i=a.onload;a.onload=function(){a.setAttribute("data-loaded","true");b();i&&i()}}if(!a.src)a.src=d,c.appendChild(a)}function highlight(d){SyntaxHighlighter.config.bloggerMode=!0;for(var b=0;b<d.length;++b){var c=document.getElementById(d[b]);SyntaxHighlighter.highlight(void 0,c)}};
loadCss("https://sites.google.com/site/prantlf/styles/shCore.min.css")
loadCss("https://sites.google.com/site/prantlf/styles/shThemeVisualStudioLike.min.css")
loadJs("https://sites.google.com/site/prantlf/scripts/shCore.min.js", function() {
loadJs("https://sites.google.com/site/prantlf/scripts/shBrushOScript.min.js", function() {
loadJs("https://sites.google.com/site/prantlf/scripts/shBrushXml.min.js", function() {
highlight(["oscript-sample", "html-sample"])
})
})
})
})();
</script>
<br />
<div>
If you want to display OScript source code in your blog article you may want to render it with syntax highlighting. Modern text editors offer it to improve the code readability and thus increase the productivity. While you could prepare a ready HTML code with font and colour styling, it becomes inconvenient when writing more articles. Why not being able to write raw code and see it "beautified", just like in the IDE?
</div>
<br />
<div>
One of JavaScript syntax highlighting engines available is <a href="http://alexgorbatchev.com/SyntaxHighlighter">Alex Gorbatchev's SyntaxHighlihter</a>. It applies styling to raw source code on the client side in the browser, like this:
</div>
<br />
<pre class="brush: oscript;" id="oscript-sample">// Gets a Livelink document.
function DAPINODE GetDocument(Integer id)
DAPINODE node = DAPI.GetNodeByID(id, -2000, false)
if !IsError(node) and node.pSubType == $Document
#ifdef DEBUG
Echo(Str.Format("Document %1: %2", \
node.pID, node.pName))
#endif
return node
end
end
</pre>
<br />
<div>
The source code of the text above looks the same as in the Livelink Builder; just the <code>pre</code> element has special attributes to turn on the styling:
</div>
<br />
<pre class="brush: xml;" id="html-sample"><pre class="brush: oscript;" id="oscript-sample">
// Gets a Livelink document.
function DAPINODE GetDocument(Integer id)
DAPINODE node = DAPI.GetNodeByID(id, -2000, false)
if !IsError(node) and node.pSubType == $Document
#ifdef DEBUG
Echo(Str.Format("Document %1: %2", \
node.pID, node.pName))
#endif
return node
end
end
</pre>
</pre>
<br />
<div>
If you wish the same effect for your articles, follow this:<br />
<br />
<ol>
<li>Make yourself familiar how to <a href="http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html">include the SyntaxHighlighter on a web site</a> or choose <a href="http://alexgorbatchev.com/SyntaxHighlighter/integration.html">instructions according to you publishing portal</a>. If you use Blogger, there is a way how to <a href="http://prantlf.blogspot.de/2012/07/syntax-highlighting-of-source-code.html">encapsulate syntax highlighting in a single post</a> to avoid modifying the blog page template.</li>
<li>Grab the brush <a href="https://docs.google.com/open?id=0B5ed6E0JYSYVMVJjQmpEcTg1MjA">shBrushOScript.js</a> which adds the OScript support and optionally the stylesheet <a href="https://docs.google.com/open?id=0B5ed6E0JYSYVQ3dSTVJqUmlfWnc">shThemeVisualStudioLike.css</a> which defines the style you can see above. Put them to a public host of your choice to be able to refer to them from your blog.</li>
<li>Update your SyntaxHighlighter integration (either in the page template or in the single post) to refer to those two files.</li>
</ol>
<br />
Actually, the Livelink Builder IDE doesn't provide such syntax highlighting yet... If you're interested you can learn about a <a href="http://prantlf.blogspot.de/2012/07/comfortable-editing-of-oscript-source.html">workaround for the time being</a>.</div>
<br />
<div>
Enjoy!
</div>Ferdinand Prantlhttp://www.blogger.com/profile/13961075422482202277noreply@blogger.com2tag:blogger.com,1999:blog-3849803758657468938.post-26596500775836881412012-07-08T12:59:00.000+02:002012-07-12T23:31:29.712+02:00Syntax highlighting of source code samples on Blogger - for a single article only<script type="text/javascript">
(function(){
function loadCss(d){for(var b=document.getElementsByTagName("head")[0],c=b.getElementsByTagName("link"),e=0;e<c.length;++e)if(0<=c[e].href.indexOf(d))return;c=document.createElement("link");c.rel="stylesheet";c.type="text/css";c.href=d;b.appendChild(c)}
function loadJs(d,b){for(var c=document.getElementsByTagName("head")[0],e=c.getElementsByTagName("script"),a,f=0;f<e.length;++f){var g=e[f];if(0<=g.src.indexOf(d)){a=g;break}}if(!a)a=document.createElement("script"),a.type="text/javascript";if(b)if(a.readyState)if("loaded"==a.readyState||"complete"==a.readyState)b();else{var h=a.onreadystatechange;a.onreadystatechange=function(){("loaded"==a.readyState||"complete"==a.readyState)&&b();h&&h()}}else if(a.getAttribute("data-loaded"))b();else{a.async=
!1;var i=a.onload;a.onload=function(){a.setAttribute("data-loaded","true");b();i&&i()}}if(!a.src)a.src=d,c.appendChild(a)}function highlight(d){SyntaxHighlighter.config.bloggerMode=!0;for(var b=0;b<d.length;++b){var c=document.getElementById(d[b]);SyntaxHighlighter.highlight(void 0,c)}};
loadCss("https://sites.google.com/site/prantlf/styles/shCore.min.css")
loadCss("https://sites.google.com/site/prantlf/styles/shThemeVisualStudioLike.min.css")
loadJs("https://sites.google.com/site/prantlf/scripts/shCore.min.js", function() {
loadJs("https://sites.google.com/site/prantlf/scripts/shBrushJScript.min.js", function() {
loadJs("https://sites.google.com/site/prantlf/scripts/shBrushXml.min.js", function() {
highlight(["js-sh-loader", "js-sh-chain", "html-sh-sample", "js-sh-real"])
})
})
})
})();
</script>
<br />
<div>
I wanted to integrate <a href="http://alexgorbatchev.com/SyntaxHighlighter">Alex Gorbatchev's SyntaxHighlihter</a> to a blog article on <a href="http://blogspot.com/">Blogger</a>. There is a <a href="http://alexgorbatchev.com/SyntaxHighlighter/integration.html">multitude of instructions</a> available but all of them have one thing in common: <b>modification of the blog page template</b> to include all necessary scripts and stylesheets. It will enable the syntax highlighter on every page but also make every page always load it.
</div>
<br />
<div>
Well, if you don't use a code excerpt in every post, why should your <b>every page load the syntax highlighting engine</b>? It should be possible to enable it just for a particular post, shouldn't it?
</div>
<br />
<div>
Yes, it is possible - with an additional JavaScript code in your blog post. If you are familiar with the <a href="http://mlawire.blogspot.de/2009/07/blogger-syntax-highlighting.html">usual blog template modification</a> the following idea adds just <b>inserting stylesheets and scripts to the page head on-demand</b>. When you're writing a blog article with some source code you'll enter the HTML editing mode, create a <code><script type="text/javascript">...</script></code> element in and put the following code to its body: (a double-click within the code will select it all to enable putting it to clipboard easily)
</div>
<br />
<pre class="brush: js;" id="js-sh-loader">(function() {
function loadCss(url){
var head = document.getElementsByTagName("head")[0]
var styles = head.getElementsByTagName("link")
for (var i = 0; i < styles.length; ++i)
if (styles[i].href.indexOf(url) >= 0)
return
var style = document.createElement("link")
style.rel = "stylesheet"
style.type = "text/css"
style.href = url
head.appendChild(style)
}
function loadJs(url, after){
var head = document.getElementsByTagName("head")[0]
var scripts = head.getElementsByTagName("script")
var script
for (var i = 0; i < scripts.length; ++i) {
var current = scripts[i]
if (current.src.indexOf(url) >= 0) {
script = current
break
}
}
if (!script) {
script = document.createElement('script')
script.type = "text/javascript"
}
if (after)
if (script.readyState)
if (script.readyState == "loaded" ||
script.readyState == "complete") {
after()
} else {
var oldreadystatechange = script.onreadystatechange
script.onreadystatechange = function() {
if (script.readyState == "loaded" ||
script.readyState == "complete")
after()
if (oldreadystatechange)
oldreadystatechange()
}
}
else {
if (script.getAttribute("data-loaded")) {
after()
} else {
script.async = false
var oldload = script.onload
script.onload = function() {
script.setAttribute("data-loaded", "true")
after()
if (oldload)
oldload()
}
}
}
if (!script.src) {
script.src = url
head.appendChild(script)
}
}
function highlight(tags) {
SyntaxHighlighter.config.bloggerMode = true
for (var i = 0; i < tags.length; ++i) {
var tag = document.getElementById(tags[i])
SyntaxHighlighter.highlight(undefined, tag)
}
}
// Use a public hosting site of your choice instead of "...".
loadCss(".../shCore.css")
loadCss(".../shThemeDefault.css")
loadJs(".../shCore.js", function() {
// Add other brushes to this chain as necessary.
loadJs(".../shBrushJScript.js", function() {
// List IDs of elements to highlight their content.
highlight([ "js-sample1", "js-sample2" ])
})
})
}());
</pre>
<br />
<div>
Notice the <b>three comments above</b> - those places you are supposed to modify according to your blog article.
</div>
<br />
<div>
<b>1.</b> The stylesheets and scripts must be <b>loaded from a publicly accessible URL</b>. You can use <a href="http://alexgorbatchev.com/SyntaxHighlighter/hosting.html">Alex's hosting</a> but if you have a possibility to put the files onto your site you should prefer it; the bandwith of Alex's site is not unlimited... For example, if you have your pages on <a href="https://sites.google.com/">Google Sites</a>, which may be likely because both Blogger and Sites are provided by Google, you can upload the SyntaxHighlighter support there and refer to them from the script, for example:</div>
<br />
<pre>https://sites.google.com/site/<i>your_name</i>/css/shCore.css
https://sites.google.com/site/<i>your_name</i>/css/shThemeDefault.css
https://sites.google.com/site/<i>your_name</i>/js/shCore.js
https://sites.google.com/site/<i>your_name</i>/js/shBrushJScript.js
</pre>
<br />
<div>
<b>2.</b> If you need multiple languages (brushes) in your article you'll <b>load them in a chain of calls</b> one after another. The following script is loaded first when the previous one has been finished; it would be done so anyway by the browser but it allows essentially the last expression that starts the highlighting to be executed after all scripts were processed: (see the latest list of <a href="http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/">built-in brushes</a> and also <a href="http://www.undermyhat.org/blog/2009/09/list-of-brushes-syntaxhighligher/">additional ones</a>)</div>
<br />
<pre class="brush: js;" id="js-sh-chain">loadJs(".../shCore.js", function() { // Common
loadJs(".../shBrushJScript.js", function() { // JavaScript
loadJs(".../shBrushCss.js", function() { // CSS
// Highlight the code; all brushes are loaded now.
highlight([ "js-sample1", "js-sample2" ])
})
})
})
</pre>
<br />
<div>
<b>3.</b> When placing a code excerpt to the article, in addition to the usual attributes, you'll give the <code>pre</code> element a <b>unique ID that you include in the array</b> of element IDs sent to the function <code>highlight</code> as shown above:
</div>
<br />
<pre class="brush: html;" id="html-sh-sample"><pre class="brush: js;" id="js-sample1">
...
</pre>
</pre>
<br />
<div>
When writing HTML or XML samples, an <a href="http://mlawire.blogspot.de/2009/07/html-encoder-encode-html-entities.html">on-line HTML encoder</a> may help you to escape special characters. (The brush for HTML is the shBrushXml.js, btw.) You can consider minifying the JavaScript code above and the external scripts you include by the <a href="https://code.google.com/p/closure-compiler/">Google Closure Compiler</a> or a similar tool. There are tools for minifying CSS files too, even <a href="http://cssminifier.com/">on-line</a>. For example, this is the partially minified code I've used for my articles:</div>
<br />
<pre class="brush: js;" id="js-sh-real">(function() {
function loadCss(d){for(var b=document.getElementsByTagName("head")[0],c=b.getElementsByTagName("link"),e=0;e<c.length;++e)if(0<=c[e].href.indexOf(d))return;c=document.createElement("link");c.rel="stylesheet";c.type="text/css";c.href=d;b.appendChild(c)}
function loadJs(d,b){for(var c=document.getElementsByTagName("head")[0],e=c.getElementsByTagName("script"),a,f=0;f<e.length;++f){var g=e[f];if(0<=g.src.indexOf(d)){a=g;break}}if(!a)a=document.createElement("script"),a.type="text/javascript";if(b)if(a.readyState)if("loaded"==a.readyState||"complete"==a.readyState)b();else{var h=a.onreadystatechange;a.onreadystatechange=function(){("loaded"==a.readyState||"complete"==a.readyState)&&b();h&&h()}}else if(a.getAttribute("data-loaded"))b();else{a.async=
!1;var i=a.onload;a.onload=function(){a.setAttribute("data-loaded","true");b();i&&i()}}if(!a.src)a.src=d,c.appendChild(a)}function highlight(d){SyntaxHighlighter.config.bloggerMode=!0;for(var b=0;b<d.length;++b){var c=document.getElementById(d[b]);SyntaxHighlighter.highlight(void 0,c)}};
loadCss("https://sites.google.com/site/your_name/styles/shCore.min.css")
loadCss("https://sites.google.com/site/your_name/styles/shThemeVisualStudioLike.min.css")
loadJs("https://sites.google.com/site/your_name/scripts/shCore.min.js", function() {
loadJs("https://sites.google.com/site/your_name/scripts/shBrushJScript.min.js", function() {
loadJs("https://sites.google.com/site/your_name/scripts/shBrushXml.min.js", function() {
highlight(["js-sh-loader", "js-sh-chain", "html-sh-sample", "js-sh-real"])
})
})
})
}());
</pre>
<br />
<div>
Loading the syntax highlighting support only for articles that actually need it takes a little more care than having it loaded on all pages automatically, indeed. But you'll have your readers download less data and make fewer HTTP requests when browsing your regular pages. And when you replace you blog template with another one you won't need bother editing it to include your modifications; your blog articles will be encapsulated with all extras they need to be rendered.</div>
<br />
<div>
Enjoy!
</div>Ferdinand Prantlhttp://www.blogger.com/profile/13961075422482202277noreply@blogger.com0tag:blogger.com,1999:blog-3849803758657468938.post-91048453419555590752012-07-06T15:15:00.000+02:002012-07-07T17:17:50.074+02:00Comfortable editing of OScript source code<a href="http://www.greggriffiths.org/">Greg Griffiths</a> published on his web site <a href="http://greggriffiths.org/livelink/development/oscript/texteditors/">an interesting list of text editor extensions</a> that enable more comfortable editing of OScript sources than inside the Livelink Builder IDE (see <a href="http://greggriffiths.org/livelink/development/oscript/texteditors/">the original Greg's page</a> for the most recent list):<br />
<br />
<table style="background-color: white; border: 2px solid rgb(51, 51, 153); font-family: Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px;"><tbody>
<tr style="background-color: #cccccc;"><th style="padding: 5px;">Editor</th><th style="padding: 5px;">Add On</th></tr>
<tr><td style="padding: 5px;"><a href="http://www.textpad.com/" style="color: #05447e;" title="TextPad">TextPad</a></td><td style="padding: 5px;"><a href="http://www.greggriffiths.org/livelink/development/oscript/texteditors/textpad-oscript.zip" style="color: #05447e;">Add On</a> <a href="http://www.textpad.com/add-ons/syna2g.html#instructions" style="color: #05447e;" title="Instructions">Instructions</a></td></tr>
<tr><td style="padding: 5px;"><a href="http://notepad-plus-plus.org/" style="color: #05447e;">Notepad++</a></td><td style="padding: 5px;"><a href="http://www.pagic.co.uk/blog/2012/07/builder-oscript-editor/" style="color: #05447e;">Add On</a></td></tr>
<tr><td style="padding: 5px;"><a href="http://www.editplus.com/" style="color: #05447e;" title="Edit Plus">Edit Plus</a></td><td style="padding: 5px;"><a href="http://www.editplus.com/dn.php?n=oscript.zip" style="color: #05447e;" title="Edit Plus Add On">Add On</a></td></tr>
<tr><td style="padding: 5px;"><a href="http://sourceforge.net/projects/scintilla/" style="color: #05447e;" title="Scintilla">Scintilla</a></td><td style="padding: 5px;"><a href="http://sourceforge.net/tracker/index.php?func=detail&aid=3523197&group_id=2439&atid=352439" style="color: #05447e;" title="Scintilla Add On">Add On</a></td></tr>
</tbody></table>
<br />
The add-ons provide syntax highlighting and/or code block folding for OScript sources. Modern editing components offer more convenience than the Livelink Builder IDE and even though you'd have to paste the resulting code back to the Livelink Builder editor when finished, you might still feel more comfortable than when typing in the Livelink Builder editor all the time.<br />
<br />
I got interested because <i>I actually do this</i>. I use <a href="http://www.scintilla.org/SciTE.html"><b>SciTE</b></a> (a programmer's notepad, originally a demonstration application for the <a href="http://www.scintilla.org/">Scintilla</a> editing component) when working with OScript sources, mainly for three things:<br />
<ol>
<li>Write longer scripts. Autocompletion and calltip help improves the productivity.</li>
<li>Review source code. Code structure emphasized by the font style is easier to go through.</li>
<li>Default viewer for opening *.osx files from <a href="http://www.perforce.com/product/components/perforce_visual_client">Perforce Visual Client</a>. I find myself looking and comparing code from other branches pretty often; code block folding and calltip help are very useful to understand foreign code.</li>
</ol>
<span style="background-color: white;">SciTE (actually Scintilla) offers advanced editing features, search/replace, block operations and other features you find in editors of modern IDEs like Microsoft Visual Studio. Specifically for OScript sources, there is </span><b style="background-color: white;">syntax highlighing, code block folding and calltip help</b><span style="background-color: white;"> for the language itself and also for objects from the Livelink core API.</span><br />
<br />
If you like the screenshots below and want the same viewing/editing experience you'll need to <a href="http://sourceforge.net/projects/scintilla/files/SciTE/">download</a> at least the <a href="http://sourceforge.net/projects/scintilla/files/SciTE/3.2.0/">version 3.2.0 of SciTE</a> that has OScript support built in. Linux users can simply install the latest SciTE from the package repository of their distribution. Additionally you'll grab and install the <a href="http://scite-files.googlecode.com/svn-history/trunk/extras/oscript.api.zip">OScript API description</a> from the <a href="http://code.google.com/p/scite-files/wiki/Customization">SciTE customization page</a> to get autocompletion and calltip help.<br />
<br />
Enjoy!<br />
<br />
<div style="background-color: white; font-family: Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4XjZFstxhnZuqP2ntPk8O5yF2sexv7RLCuIngFws8fy2Trpe8R_bOurzH8XJkgwvbLVDwLsq9ym5r5AaimFL8WfGfP96MZjJtzmJsAErYxZFU6E-p-4oeGv98_r-_BzQEMugKdPoCA78/s1600/Autocompletion.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="292" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4XjZFstxhnZuqP2ntPk8O5yF2sexv7RLCuIngFws8fy2Trpe8R_bOurzH8XJkgwvbLVDwLsq9ym5r5AaimFL8WfGfP96MZjJtzmJsAErYxZFU6E-p-4oeGv98_r-_BzQEMugKdPoCA78/s320/Autocompletion.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgisZ_h6AiaX2QnVNxxyxFbcMXlU6hiS4J1OWwg0-JkzMyti7YuSFDZjYIXJWUlYwWONa6w-Td4_PODwCqMwh9BRPe0l5gZx4O2IzN99H4z2eMgAxdkuUnVqHBeua4GfdWzK3QiGML_FZQ/s1600/CalltipHelp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="271" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgisZ_h6AiaX2QnVNxxyxFbcMXlU6hiS4J1OWwg0-JkzMyti7YuSFDZjYIXJWUlYwWONa6w-Td4_PODwCqMwh9BRPe0l5gZx4O2IzN99H4z2eMgAxdkuUnVqHBeua4GfdWzK3QiGML_FZQ/s320/CalltipHelp.png" width="320" /></a></div>
<span style="font-family: 'Times New Roman'; font-size: small;"><br /></span></div>Ferdinand Prantlhttp://www.blogger.com/profile/13961075422482202277noreply@blogger.com2tag:blogger.com,1999:blog-3849803758657468938.post-62117226357669835662011-07-07T13:29:00.001+02:002012-07-07T17:21:18.270+02:00dirsync - directory content synchronization tool<div>
I released an older project of mine - <a href="http://prantl.host.sk/dirsync/"><b>dirsync</b></a>. It is a command-line tool to synchronize content (files and folders) of two directories. Why another tool when <a href="http://en.wikipedia.org/wiki/Rsync">rsync</a> and his relatives have been already there? Dirsync makes sure that the free space on the target drive does not get exhausted if it is almost full and many files were changed on the source drive. It performs the deletion operations at first to make place for the new files to be copied there.</div>
<br />
<div>
For example, how to synchronize photos from the working drive to a backup one recursively including subfolders:</div>
<br />
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> dirsync D:\Photos E:\Photos</span></div>
<br />
<div>
Firstly, files are deleted from the target directory that cannot be found in the source one. Then existing files get updated if their source counterparts have newer last modification time. Finally, new files are copied to the target drive.</div>
<br />
<div>
What to do if there are two root directories on a single drive to synchronize and you still make sure all files to be deleted are processed first? Specify the operations to perform selectively:</div>
<br />
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> dirsync -o:delete D:\Movies E:\Movies</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> dirsync -o:delete D:\Music E:\Music</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> dirsync -o:update,create D:\Movies E:\Movies</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> dirsync -o:update,create D:\Music E:\Music</span></div>
<br />
<div>
Sources of the tool are maintained in the <a href="https://github.com/prantlf/dirsync/">github repository</a>.</div>Ferdinand Prantlhttp://www.blogger.com/profile/13961075422482202277noreply@blogger.com0