|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Perlapp that requires NET::FTP
I have an ftp application that will work if a user has perl installed, however the goal is to make the excutable file the only file required.
I thought, I had solved it earlier today but... I was wrong. I am using perlapp version PDK-5.2.0.520.msi ...and command line: perlapp c:\tmp\ftp_it.cgi -f -a=Net::FTP I got the application working but can not get the excutable to function correctly? Someone might have run into this? Help! #!/usr/bin/perl #################################################### #FTP_IT - ftp_it.cgi #################################################### #Created by Kevin Brake - theboss@cansomebodyhelpme.com #Created on Feb 15, 2004 #################################################### #Overview: #A user can edit a single config file ftp_info.txt. # #This will enable users to upload one file or all #files contained in a directory. # #This script can tell the difference between file #types ACSII and Binary. # #This script can set permissions based on file names ##################################################### #Files Included # #The script #ftp_it.cgi # #The config file #ftp_info.txt # #Automatically Created - FTP Transfer Record #ftp_record.txt #################################################### require ('ftp_info.txt'); #require ('FTP.pm'); use Net::FTP; #use CGI::Carp qw(fatalsToBrowser warningsToBrowser); if ($do_all_files_in_dir eq "false") { &start_ftp; }else{ #First Get Files from current directory opendir(CURDIR1,"$send_path")|| die("Cannot open Send Path Directory!"); @files=readdir(CURDIR1); closedir(CURDIR1); foreach $file (@files) { if ($file eq '.'){next} if ($file eq '..'){next} &start_ftp; }#end foreach }#end else sub start_ftp { $ftp=Net::FTP->new($host); $ftp->login($user,$pw) or die "could not login"; $ftp->cwd($server_path) or die "could not cwd $server_path"; if ($file =~ /\.(gif|jpeg|jpg|class|ico|exe|doc|eot|jar|tar|gz|zip|pdf|png)$/i) { # BINARY files $file_type = "binary"; $file_permissions = "chmod 0644"; }elsif ($file =~ /\.(cgi|pl)$/i){ # CGI-BIN Programs $file_type = "ascii"; $file_permissions = "chmod 0755"; }else{ # ASCII files $file_type = "ascii"; $file_permissions = "chmod 0644"; } $ftp->$file_type; $ftp->send($file) or die "could not put $file"; #$ftp->put($file) or die "could not put $file"; #$ftp->get($file) <-- download the file; $ftp->site($file_permissions.$file) or die "could not chmod $file_permissions.$file"; push(@files_sent, ("$file"." uploaded as a $file_type file"." $file_permissions")); } $ftp->quit; $display_ftp_files = join ("\n", @files_sent); ###CREATE A VARIABLE TO HOLD CURRENT DATE - START @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); @months = ('January','February','March','April','May','June','July','August','September','October','November', 'December'); # Get the current time and format the hour, minutes and seconds. Add # 1900 to the year to get the full 4 digit year. ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec); $year += 1900; $date_of_ftp = "$days[$wday], $months[$mon] $mday, $year"; ###CREATE A VARIABLE TO HOLD CURRENT DATE - END open(FTP_RECORD,">ftp_record.txt"); print FTP_RECORD "FTP Transfer Record - $date_of_ftp\n"; print FTP_RECORD "Host: $host\n"; print FTP_RECORD "User: $user\n"; print FTP_RECORD "Password: $pw\n"; print FTP_RECORD "Path: $server_path\n"; print FTP_RECORD "Uploaded File(s)\n"; print FTP_RECORD "$display_ftp_files\n\n"; print FTP_RECORD "Some servers may require manual chmod for 0755\n"; close(FTP_RECORD); exit; #################################################### #FTP_IT - ftp_info.txt #################################################### #Created by Kevin Brake - theboss@cansomebodyhelpme.com #Created on Feb 15, 2004 #################################################### #Config Files for ftp_it.cgi #################################################### $host=""; $user=""; $pw=""; $server_path="/downloads/test"; #Take note default upload all files in a directory - true or false $do_all_files_in_dir = "true"; #If you want to upload a single file remove the comment symbol from the line #$file = "smcover.jpg"; #Below is where your files would be located #c:\tmp\test #Below is how you would enter in the location $send_path="/tmp/test"; 1; #return true Thanks, Kevin
__________________
[S.O.D]KGB http://www.sod.b3.nu Last edited by [S.O.D]KGB : February 16th, 2004 at 02:28 PM. |
|
#2
|
|||
|
|||
|
I found this information that maybe my problem: I am running win98se
Note: if you are running under Windows Me/98/95, you will not be able to build an executable using PerlApp, because several Win32 API function calls required by PerlApp are unavailable. You can build the Perl executable under Windows NT/2000, and then run the resultant .exe file under Windows Me/98/95. Found this above from: http://aspn.activestate.com/ASPN/do...pp/Options.html |
|
#3
|
|||
|
|||
|
I am still searching for alteratives please offer some detailed suggestions as this would get me off to a good running start when making any other .exe files from perl scripts.
Thanks, Kevin |
|
#4
|
|||
|
|||
|
I have been working on using perl2exe still getting errors?
C:\temp>perl2exe c:\tmp\ftp_it.cgi #perl2exe_include NET::FTP Perl2Exe V8.00 Copyright (c) 1997-2004 IndigoSTAR Software This is an evaluation version of Perl2Exe, which may be used for 30 days. For more information see the attached pxman.htm file, or visit http://www.indigostar.com Converting 'c:/tmp/ftp_it.cgi #perl2exe_include NET::FTP' to ftp_it.exe Warning: Can't locate ftp_info.txt at c:\tmp\ftp_it.cgi line 33 @INC = C:\PERL\lib, C:\PERL\site\lib, . Warning: Can't locate Convert/EBCDIC.pm at C:\PERL\site\lib\Net\Cmd.pm line 19 @INC = C:\PERL\lib, C:\PERL\site\lib, . Warning: Can't locate Mac/InternetConfig.pm at C:\PERL\site\lib\Net\Config.pm line 40 @INC = C:\PERL\lib, C:\PERL\site\lib, . |
|
#5
|
|||
|
|||
|
I have attempted to use pp and par without luck. Could be based on no exact examples were provided on how to do use these apps - pp and par when running perl in a windows98se environment.
![]() |
|
#6
|
|||
|
|||
|
Have you tried adding the package? I had two of the same errors you have listed and resolved them by starting PPM, searching and installing EBCDIC:
s EBCDIC install convert-EBCDIC HTH edit: funny when you respond and then see the issue is 6+ months old.... |
|
#7
|
|||
|
|||
|
Thank you for your reply
I will give that a try, I am currently making a move and got my computers being shipped.
I think it might also be a solution to just upgrade the operating system. All the best. |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > Perlapp that requires NET::FTP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|