Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TFTP transfer mode problem, files unreadable 1

Status
Not open for further replies.

mhbroon

Technical User
Mar 16, 2004
5
GB
Afernoon All,
I hope someone could help me in regards to a small tftp problem i am having.

I am connecting to a network element (radio) via its ip address and then tftp'ing the file to a local folder.
I know the tftp works, as i can open the files. The trouble is my understanding of the mode of transfer part of the code.
If i leave all options of defining the mode the files i require are downloaded; ie; file 1 is a log file and file 2 is a pm file (performance). I can read file 1 no problems, all in plain english as a text file. The pm file asks you to choose the format to view, i pick notepad for instance and it is just a jumble of heirogliphics.
To me it is a transfer problem, but i may be putting that command in wrong, any ideas of what i may be doing wrong and where to put the correct command (no sick suggestions please)!!!

Here is some example code:

sub tftpne {
$tftp = new TFTP ($ipaddress);
$tftp ->mode (binary); #this line, (left in or out)makes no difference to the output to local folder???
$tftp ->get ("/pmon/weekly-total.pm");
$tftp ->get ("/log/debug.log");
$tftp ->quit;
}

This subroutine is called when a specific ne is found. The options for transfer are netascii, ascii, octet and binary.

Ok, please throw some suggestions into the pot for me

Regards
mhb
 
Is the .pm file normally readable by a text editor, or is it normally read by another application?

--Paul
 
Paul,
I don't know is the honest answer. But i shall get back to you, i have never had to look at them before, but i believe they may need a hex viewer of some description. Apparently it might be a better to try and view in Linux as it has some software on it that might do the job. But i am on win at the mo.
If that is the case is there something that Perl may be able to do in regards of hex conversion???

Thanks
mhb
 
If you look at an executable in a text editor you're going to see similar heiroglyphs...

Data files, if you scan through them chances are you might see some human readable sequences (usually in the header or footer). If you've transferred as binary chances are you've done right, you just need the correct software to view it

HTH
--Paul

 
Thanks Paul,
I will have a look at the file in a bit more detail, and see if i can download some freeware for a hex converter or something.
Also i need to have a look if i can convert the file from hex after the transfer, should be something i can write in using Perl

ttfn
mhb
 
I haven't got a sample of your file, but if you look at the pack and unpack functions you should get an idea of what you need to do

--Paul
 
What brand of radio are you accessing?
I know that most have binary data in their performance files.
 
Its a NEC radio.
I have had a chat with some people and are pretty sure i should be using binary as the format, but the format might be NEC propriety software, so we are contacting them to find out how to view it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top