Solved

tftp client

Posted on 1997-06-06
4
825 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Sort Question 4 141
Rename file based on contents in the file? 3 102
Perl regex to replace any capital letters not preceded by ">" 6 164
combine multiple lines 2 74
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…

733 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