head	1.2;
access;
symbols
	tcllib-1-13:1.2
	tcllib-1-12:1.2
	tklib-0-5:1.2
	tcllib-1-11-1:1.2
	tcllib-1-11:1.2
	tcllib-1-10:1.2
	tcllib-1-9:1.2
	tcllib-1-8:1.2
	tcllib-1-7:1.2
	tcllib-1-6-1:1.1.6.1
	tcllib-1-6-branch:1.1.0.6
	tcllib-1-6:1.1
	tcllib-1-4-0:1.1
	tcllib-1-3-0:1.1
	tcllib-1-2-0:1.1.0.4
	RELEASES:1.1.0.2;
locks; strict;
comment	@# @;


1.2
date	2004.03.09.08.20.17;	author andreas_kupries;	state Exp;
branches;
next	1.1;

1.1
date	2001.11.08.06.26.41;	author andreas_kupries;	state Exp;
branches
	1.1.6.1;
next	;

1.1.6.1
date	2004.05.24.02.58.09;	author andreas_kupries;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Unified the startup header of all applications, using
suggestions made by Stuart Cassof <stwo@@telus.net>.
@
text
@#! /bin/sh
# -*- tcl -*- \
exec tclsh "$0" ${1+"$@@"}

# Author: [Larry W. Virden] [LV], modified Andreas Kupries [AK]
# Version: 3
# Validate the ftp: urls given on the command line.

package require uri
package require ftp

# Should eventually add a command line argument to toggle verbose
#set ftp::VERBOSE 1

if {0} {
    proc ftp::DisplayMsg {s msg {state ""}} {
	upvar ::ftp::ftp$s ftp
	variable VERBOSE

	switch -exact -- $state {
	    data {
		if { $VERBOSE } { puts $msg }
	    }
	    control {
		if { $VERBOSE } { puts $msg }
	    }
	    error {
		if { $VERBOSE } { puts "E: $msg" }
		#error "ERROR: $msg"
	    }
	    default {
		if { $VERBOSE } { puts $msg }
	    }
	}
	return
    }
}

foreach arg $argv {
    array set current [uri::split $arg]

    # parray current

    if {[catch {
	set fdc [ftp::Open $current(host) anonymous enteryourname@@here.com]
    } returncode]} {
	puts stderr [format "error 1: unable to open %s\n" $current(host)]
	continue
    }
    set ftp_dir  [file dirname $current(path)]
    set ftp_file [file tail    $current(path)]

    if {[catch {
	set result [ftp::Cd $fdc $ftp_dir] } returncode]
    } {
	puts stderr [format "error 2: unable to enter directory %s:%s\n" $current(host) $ftp_dir]
	continue
    }

    if { $result == 0 } {
	puts stderr [format "error 3: failure to enter %s:%s\n" $current(host) $ftp_dir]
	continue
    }

    if {[catch {
	set result [ftp::List $fdc "${ftp_file}*"] } returncode]
    } {
	puts stderr [format "error 4: no match for ${ftp_file}*\n" $current(host) $ftp_dir]
	continue
    }
    if { $result == {} } {
	puts stderr [format "error 5: no match for ${ftp_file}*\n" $current(host) $ftp_dir]
	continue
    }

    ftp::Close $fdc
}

exit
@


1.1
log
@
	* examples/ftp/ftpvalid: New example, using ftp and uri
	  modules. Validation of ftp urls.

	* fileutil: Accepted Patch #477805.
	* ftp:      Accepted Patch #478478.

	* fileutil.test:
	* fileutil.n:
	* fileutil.tcl: Applied patch #477805 by Glenn Jackman
	  <glennjnn@@users.sourceforge.net> implementing the unix 'touch'
	  command. Contains documentation and testsuite for the new
	  command too.

	* ftp.tcl: Applied patch in #478478 to handle non-standard date
	  information from servers with a buggy y2k patch. 2001 is
	  rendered as 19101 (19*100 + 101 = 2001).
@
text
@d1 1
a1 1
#!/bin/sh
d4 1
@


1.1.6.1
log
@Downgraded to version 1.3.6, removed -decode extension from
this branch.

Import of ftpd bugfix by Gerald Lester.

Last commit was a bad update, caused duplicates of changes
to appear. Failed testsuite. Removed all the duplicates now.

Fixed SF Tcllib Bug 954328. Mime now adapts at runtime to
whatever version of md5 has been loaded.

Updated test for rewritten adjust which fixed the infinite
looping demonstrated by tests 2.6 and 2.7. Also fixed a var
usage typo which caused a copy of the input to appear in the
output, before the expected formatted result.

Fixed bug in the processing of multi-word section titles for
text based formats.

Fixed bug 951568, regarding the usage of Trf's generic
transform.

Fixed problems with jpeg recognition (was unable to detect a
jpeg file, if it contained exif data).

Changelog for last patch, and updates in related package.

Completed application of code for various fixes.

Rewritten text adjustment and hyphenation, fixing SF TCllib
Bug 882402.

Fixed SF Tcllib Bug 936064, and evals more robust.

Fixed SF Tcllib Bug 893516

Fixed SF Tcllib Patch 763712

Fixed SF Tcllib Patch 758742

Fixed SF Tcllib Bug 620852

Eval usage made more robust and similar.

Fixed SF Tcllib Bug 943146.

Fixed SF Tcllib Bug 940651

SF Tcllib Bug 784519 fixed.

Pat: sak.tcl update for better use of critcl.

Joe: Fix in doctools xml support.

Import bugfix by Pat Thoyts, Handling of data starting with
hyphen/dash

Import of uuencode changes by Jeff Hobbs.

Changed defaults for package 'log'. No output for the all
levels below 'error'.

Unified the startup header of all applications, using
suggestions made by Stuart Cassof <stwo@@telus.net>.

Added testcase for Tcllib SF Bug 860753. The bug itself was
already fixed for Tcllib 1.6.

Fix for bug 899204. Test data file is opened read-only, and
tests made independent of each other.

Bugfix 899152, 899209. Require Tcl 8.2 for installer, delete
file before writing over it.

Import of time fix by Pat Thoyts, patch #905132.

Cleanup fix: Snit depends on Tcl 8.4, this is documented,
however neither package index, nor testsuite enforced the
restriction, allowing for errors. This has been changed now.

Fixed typos
@
text
@d1 1
a1 1
#! /bin/sh
a3 1

@


