Solved

tftp client

Posted on 1997-06-06
4
817 Views
Last Modified: 2012-05-04
I am trying to write an implementation of a tftp client and
would be really grateful for any help and/or sample code anyone could provide.
Initially all that is required is the ability to "get" files
in octet mode.

The reason: I need to collect files which are produced in real time on an hourly basis. Spawning tftp commands means running tftp, closing it, reading errors and, if required, spawning a repeat of the same tftp command if a recoverable error has occured (such as the file not being ready - not unusual to have this occur up to thirty times). For performance gains I could open a socket and perform all recovery within perl and not have the overhead involved of running tftp multiple times.
I have the RFC and Network Programming by Stevens with an example of a tftp client/server.  What I would really like is an example of Perl doing this kind of thing.  I am a DBA - my knowledge of sockets and Perl is sadly lacking!  I am also looking into using "expect" to run the tftps but have no idea about its performance.

Hope this makes more sense now.

I thought I would be emailed with the reply - I have not been checking the site.  Could you e-mail me if the answer is updated?  (Michael.Cameron@MCI.com)

Thanks in advance
0
Comment
Question by:mcameron
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
mkornell earned 280 total points
ID: 1204220
The relevant standards doc is RFC1350.  This can be found at http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1350.txt

From the document's summary:

TFTP is a very simple protocol used to transfer files.  It is from this that its name comes, Trivial File Transfer Protocol or TFTP.  Each nonterminal packet is acknowledged separately.  This document describes the protocol and its types of packets.  The document also explains the reasons behind some of the design decisions.

If you'd rather a full implementation of FTP, you could use the Net::FTP package from CPAN (http://www.perl.org/CPAN/CPAN.html), which is part of the libnet bundle.

Rather than reinventing the wheel, if you are using Unix, it might be easier to have perl drive the command-line tftp client.

HTH,
--mark;
0
 

Author Comment

by:mcameron
ID: 1204221
Edited text of question
0
 

Author Comment

by:mcameron
ID: 1204222
If you can supply some examples I would be most grateful.


0
 

Author Comment

by:mcameron
ID: 1204223
Also received sample code - excellent!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MySQL Web Database 5 111
work on ods spreadsheet with perl in ubuntu 4 75
Regular Expression question to filter with negation. 6 89
Perl Write to Specific line in a file 15 75
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now