<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Albertux~# ./Blog &#187; batch</title>
	<atom:link href="http://albertux.ayalasoft.com/es/tag/batch/feed/" rel="self" type="application/rss+xml" />
	<link>http://albertux.ayalasoft.com</link>
	<description>61 20 64 65 76 65 6c 6f 70 65 72 20 6c 69 66 65</description>
	<lastBuildDate>Thu, 01 Jul 2010 16:23:33 +0000</lastBuildDate>
	<language>es</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.5.3" -->
	<copyright>2008 </copyright>
	<managingEditor>albertoi7@gmail.com (Albertux~# ./Blog)</managingEditor>
	<webMaster>albertoi7@gmail.com (Albertux~# ./Blog)</webMaster>
	<category>posts</category>
	<ttl>1440</ttl>
	<image>
		<url>http://ayalasoft.com/img/podcast02.jpg</url>
		<title>Albertux~# ./Blog &#187; batch</title>
		<link>http://albertux.ayalasoft.com</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>After three days without programming, life becomes meaningless.</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Technology">
		<itunes:category text="Software How-To" />
	</itunes:category>
	<itunes:category text="Technology">
		<itunes:category text="Podcasting" />
	</itunes:category>
	<itunes:author>Albertux~# ./Blog</itunes:author>
	<itunes:owner>
		<itunes:name>Albertux~# ./Blog</itunes:name>
		<itunes:email>albertoi7@gmail.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://ayalasoft.com/img/podcast01.jpg" />
		<item>
		<title>FTP para Desarrolladores</title>
		<link>http://albertux.ayalasoft.com/es/2009/01/29/ftp-for-developers/</link>
		<comments>http://albertux.ayalasoft.com/es/2009/01/29/ftp-for-developers/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 02:54:52 +0000</pubDate>
		<dc:creator>albertux</dc:creator>
				<category><![CDATA[develop]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[unix/linux]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://albertux.ayalasoft.com/es/?p=1572</guid>
		<description><![CDATA[FTP para Desarrolladores En estos ejemplos se sube un archivo de texto plano para mejores implementaciones lea la API o la documentacion de cada lenguaje o comando Curl: curl -T filename -u username:password ftp://hostname/filename Perl: use Net::FTP; $hostname = &#34;localhost&#34;; $username = &#34;user&#34;; $password = &#34;pass&#34;; $filename = &#34;file.txt&#34;; $ftp = Net::FTP-&#62;new&#40;$hostname&#41;; $ftp-&#62;login&#40;$username,$password&#41;; $ftp-&#62;put&#40;$filename&#41;; $ftp-&#62;quit; [...]<p><a href="http://albertux.ayalasoft.com/es/2009/01/29/ftp-for-developers/">FTP para Desarrolladores</a> is a post from: <a href="http://albertux.ayalasoft.com">Albertux~# ./Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p><strong>FTP para Desarrolladores</strong></p>
<p>En estos ejemplos se sube un archivo de texto plano para mejores implementaciones lea la API o la documentacion de cada lenguaje o comando</p>
<p>Curl:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">curl <span style="color: #660033;">-T</span> filename <span style="color: #660033;">-u</span> username:password <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>hostname<span style="color: #000000; font-weight: bold;">/</span>filename</pre></div></div>

<p>Perl:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> Net<span style="color: #339933;">::</span><span style="color: #006600;">FTP</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$hostname</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;localhost&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$username</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;user&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$password</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;pass&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$filename</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;file.txt&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ftp</span> <span style="color: #339933;">=</span> Net<span style="color: #339933;">::</span><span style="color: #006600;">FTP</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$hostname</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ftp</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">login</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$username</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ftp</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$filename</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ftp</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">quit</span><span style="color: #339933;">;</span></pre></div></div>

<p>Manejo de errores usa &#8220;or die $@&#8221; (&#8220;$ftp>message&#8221; solo cuando el login haya funcionado)</p>
<p>PHP:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$hostname</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;user&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;pass&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$filename</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;file.txt&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$conn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ftp_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hostname</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #990000;">ftp_login</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$conn</span><span style="color: #339933;">,</span> <span style="color: #000088;">$username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ftp_put</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$conn</span><span style="color: #339933;">,</span><span style="color: #000088;">$filename</span><span style="color: #339933;">,</span><span style="color: #000088;">$filename</span><span style="color: #339933;">,</span>FTP_ASCII<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ftp_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Manejo de errores usando &#8220;if(!function)&#8221;</p>
<p>Python:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">ftplib</span>
hostname = <span style="color: #483d8b;">&quot;localhost&quot;</span>
username = <span style="color: #483d8b;">&quot;user&quot;</span>
password = <span style="color: #483d8b;">&quot;pass&quot;</span>
filename = <span style="color: #483d8b;">&quot;file.txt&quot;</span>
ftp = <span style="color: #dc143c;">ftplib</span>.<span style="color: black;">FTP</span><span style="color: black;">&#40;</span>hostname<span style="color: black;">&#41;</span>
ftp.<span style="color: black;">login</span><span style="color: black;">&#40;</span>username, password<span style="color: black;">&#41;</span> 
ftp.<span style="color: black;">storlines</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;STOR &quot;</span> + filename, <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
ftp.<span style="color: black;">quit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Manejo de errores usando &#8220;try&#8221;, &#8220;except&#8221; y &#8220;else&#8221;</p>
<p>Ruby:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'net/ftp'</span>
host = <span style="color:#996600;">'localhost'</span>
user = <span style="color:#996600;">'user'</span>
pass = <span style="color:#996600;">'pass'</span>
file = <span style="color:#996600;">'file.txt'</span>
ftp = <span style="color:#6666ff; font-weight:bold;">Net::FTP</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>hostname<span style="color:#006600; font-weight:bold;">&#41;</span>
ftp.<span style="color:#9900CC;">login</span><span style="color:#006600; font-weight:bold;">&#40;</span>username,password<span style="color:#006600; font-weight:bold;">&#41;</span>
ftp.<span style="color:#9900CC;">puttextfile</span><span style="color:#006600; font-weight:bold;">&#40;</span>filename<span style="color:#006600; font-weight:bold;">&#41;</span>
ftp.<span style="color:#9900CC;">close</span></pre></div></div>

<p>Manejo de errores usando &#8220;begin&#8221;, &#8220;rescue&#8221;, &#8220;else&#8221;, &#8220;ensure&#8221; y &#8220;end&#8221;.</p>
<p>Win32 batch:</p>

<div class="wp_syntax"><div class="code"><pre class="winbatch" style="font-family:monospace;"><span style="color: #0080FF; font-weight: bold;">ftp</span> <span style="color: #66cc66;">-</span>s<span style="color: #FF1010; font-weight: bold;">:settings.txt hostname</span></pre></div></div>

<p>settings.txt:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">username
password
put filename
bye</pre></div></div>

<p>Manejo de errores usando &#8220;if not %errorlevel%==0 goto :error&#8221; </p>
<p><a href="http://albertux.ayalasoft.com/es/2009/01/29/ftp-for-developers/">FTP para Desarrolladores</a> is a post from: <a href="http://albertux.ayalasoft.com">Albertux~# ./Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://albertux.ayalasoft.com/es/2009/01/29/ftp-for-developers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using Windows ? Don&#8217;t Kill Yourself</title>
		<link>http://albertux.ayalasoft.com/es/2008/10/27/using-windows-dont-kill-yourself/</link>
		<comments>http://albertux.ayalasoft.com/es/2008/10/27/using-windows-dont-kill-yourself/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 19:01:41 +0000</pubDate>
		<dc:creator>albertux</dc:creator>
				<category><![CDATA[develop]]></category>
		<category><![CDATA[unix/linux]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://albertux.ayalasoft.com/es/?p=747</guid>
		<description><![CDATA[Using Windows ? Don&#8217;t Kill Yourself Supose you are Linux user and you have a Windows system. Alternatives: Cygwin, Mingw or Colinux You need some (or all) of this interpreters: Perl, PHP, Python and Ruby Modify the %PATH% Example you have a bin dir, on C:\ to include the executables on the %PATH% do this: [...]<p><a href="http://albertux.ayalasoft.com/es/2008/10/27/using-windows-dont-kill-yourself/">Using Windows ? Don&#8217;t Kill Yourself</a> is a post from: <a href="http://albertux.ayalasoft.com">Albertux~# ./Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p><strong>Using Windows ? Don&#8217;t Kill Yourself</strong></p>
<p>Supose you are Linux user and you have a Windows system.</p>
<p>Alternatives: <a href="http://www.cygwin.com/" target="_blank">Cygwin</a>, <a href="http://www.mingw.org/" target="_blank">Mingw</a> or <a href="http://www.colinux.org/" target="_blank">Colinux</a></p>
<p>You need some (or all) of this interpreters:<br />
<a href="http://strawberryperl.com" target="_blank">Perl</a>, <a href="http://www.php.net" target="_blank">PHP</a>, <a href="http://www.python.org" target="_blank">Python</a> and <a href="http://www.ruby-lang.org/en" target="_blank">Ruby</a></p>
<p>Modify the %PATH% </p>
<p>Example you have a bin dir, on <span style="color:#00ff00">C:\</span> to include the executables on the <span style="color:#00ff00">%PATH%</span> do this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="winbatch" style="font-family:monospace;">set PATH=<span style="color: #66cc66;">%</span>PATH<span style="color: #66cc66;">%</span><span style="color: #008000; font-style: italic;">;C:\bin\</span></pre></td></tr></table></div>

<p>On Windows Vista, you can use your mouse:</p>
<p>computer > properties > Advances system settings > (continue) >  Advanced > Enviroment Variables > System Variables > Path (edit)</p>
<p>Example run Kompozer on cmd.exe but no modify <span style="color:#00ff00;">%PATH%</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="winbatch" style="font-family:monospace;"><span style="color: #FF1010; font-weight: bold;">: kompozer.bat save on %WINDIR%</span>
<span style="color: #66cc66;">@</span><span style="color: #ff0000;">&quot;C:\Program Files\Kompozer\kompozer.exe&quot;</span></pre></td></tr></table></div>

<p>Doble click on your scripts to run:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="winbatch" style="font-family:monospace;"><span style="color: #FF1010; font-weight: bold;">: Perl Scripts</span>
 assoc .pl=Perl.File
 ftype Perl.File=C<span style="color: #FF1010; font-weight: bold;">:\strawberry\perl\bin\perl.exe &quot;%1&quot; %*</span>
 set PATHEXT=<span style="color: #66cc66;">%</span>PATHEXT<span style="color: #66cc66;">%</span><span style="color: #008000; font-style: italic;">;.pl</span>
<span style="color: #FF1010; font-weight: bold;">: Python Scripts</span>
 assoc .py=Python.File
 ftype Python.File=C<span style="color: #FF1010; font-weight: bold;">:\Python26\python.exe &quot;%1&quot; %*</span>
 set PATHEXT=<span style="color: #66cc66;">%</span>PATHEXT<span style="color: #66cc66;">%</span><span style="color: #008000; font-style: italic;">;.py</span></pre></td></tr></table></div>

<p>Note:<br />
On Windows Vista you need run <span style="color:#00ff00">cmd.exe</span> as Administrator don&#8217;t work as normal user</p>
<p>Apache, PHP and MySQL ?<br />
<a href="http://www.apachefriends.org/en/xampp.html" target="_blank">XAMPP</a> and <a href="http://www.server2go-web.de/" target="_blank">Server2Go</a></p>
<p>Notes:<br />
XAMPP: simple, quick and easy install.<br />
Server2Go: is great to make CD demo of a Web Application.</p>
<p>Using Perl or Python as CGI on Windows ?</p>
<p>Using Python 2.6</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!\python26\python.exe</span></pre></td></tr></table></div>

<p>Using Strawberry Perl:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!\strawberry\perl\bin\perl.exe</span></pre></td></tr></table></div>

<p>Now your script works on http://localhost/<span style="color:#00ff00">cgi-bin/</span>script.cgi</p>
<p><a href="http://albertux.ayalasoft.com/es/2008/10/27/using-windows-dont-kill-yourself/">Using Windows ? Don&#8217;t Kill Yourself</a> is a post from: <a href="http://albertux.ayalasoft.com">Albertux~# ./Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://albertux.ayalasoft.com/es/2008/10/27/using-windows-dont-kill-yourself/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
