Perl Win32 Quick Reference

ADVERTISEMENT

PERL Win32 Quick Reference
Removes a directory on the FTP remote
Win32::MsgBox(MESSAGE [, FLAGS [, TITLE]])
$FTP ->Rmdir("olddir");
host.
Create a dialogbox containing MESSAGE. FLAGS specifies the required
Author: Jialong He
icon and buttons according to the following table:
$FTP ->Rename("old.zip",
Renames a file on the FTP remote host.
0 = OK
"new.zip");
1 = OK and Cancel
2 = Abort, Retry, and Ignore
Win32 API Functions
3 = Yes, No and Cancel
Win32::Internet
4 = Yes and No
#-------------------------------------
5 = Retry and Cancel
use Win32::Internet;
# Some info about window
MB_ICONSTOP
"X" in a red circle
$INET = new Win32::Internet();
#-------------------------------------
MB_ICONQUESTION
question mark in a bubble
$file = $INET->FetchURL(“ );
use Win32;
MB_ICONEXCLAMATION exclamation mark in a yellow triangle
print "*** Login Name: ", Win32::LoginName(), "\n";
binmode STDOUT;
MB_ICONINFORMATION "i" in a bubble
print $file;
print "*** Domain Name: ", Win32::DomainName(), "\n";
TITLE specifies an optional window title. The default is ``Perl''.
print "*** File System: ", Win32::FsType(), "\n";
print "*** OS version: ", Win32::GetOSVersion(), "\n";
The function returns the menu id of the selected push button:
print "*** IsWindowNT: ", Win32::IsWinNT(), "\n";
Open HTTP session
0 Error
print "*** TickCount: ", Win32::GetTickCount(), "\n";
1 OK
2 Cancel
Win32::SetCwd(NEWDIRECTORY)
use Win32::Internet;
3 Abort
Win32::GetCwd()
$INET= new Win32::Internet();
4 Retry
Sets/Gets current active drive and directory.
$INET->HTTP($HTTP, “hostname”, “ username”, “password”);
5 Ignore
#---------------------------------------------------------
6 Yes
# @ in email address must be escaped e.g.,
7 No
Win32::SetLastError(ERROR)
#
Win32::GetLastError()
#---------------------------------------------------------
Win32::DomainName()
Sets/Gets the value of the last error encountered to ERROR.
Returns the name of the Microsoft Network domain name.
($statuscode, $headers, $file)=$HTTP->Request(“/”);
binmode STDOUT;
print $file;
Win32::InitiateSystemShutdown(MACHINE, MESSAGE, TIMEOUT,
Win32::FsType()
FORCECLOSE, REBOOT)
Open FTP session
Shutsdown the specified MACHINE, notifying users with the supplied
Returns the name of the filesystem of the currently active drive (like 'FAT' or
MESSAGE, within the specified TIMEOUT interval. Forces closing of all
'NTFS'). In list context it returns three values: (FSTYPE, FLAGS,
documents without prompting the user if FORCECLOSE is true, and reboots
use Win32::Internet;
MAXCOMPLEN). FSTYPE is the filesystem type as before. FLAGS is a
$INET= new Win32::Internet();
the machine if REBOOT is true. This function works only on WinNT.
combination of values of the following table:
$INET->FTP($FTP, “hostname”, “username”, “password”);
0x00000001 supports case-sensitive filenames
$FTP->Cd (“path”);
0x00000002 preserves the case of filenames
$FTP->Binary ();
Win32::AbortSystemShutdown(MACHINE)
0x00000004 supports Unicode in filenames
Aborts a system shutdown (started by the InitiateSystemShutdown function)
$FTP->Get(“myfile.zip”); # file saved to myfile.zip
0x00000008 preserves and enforces ACLs
on the specified MACHINE.
$FTP->Close();
0x00000010 supports file-based compression
0x00000020 supports disk quotas
FTP Function Reference
0x00000040 supports sparse files
Win32::IsWinNT()
0x00000080 support s reparse points
Win32::IsWin95()
0x00000100 supports remote storage
Sets the ASCII (Binary) transfer mode for
$FTP ->Ascii();
Returns non zero if the Win32 subsystem is Windows NT (Windows 95).
this FTP session.
0x00008000 is a compressed volume (e.g. DoubleSpace)
$FTP ->Binary();
0x00010000 supports object identifiers
Changes the current directory on the FTP
0x00020000 supports the Encrypted File System (EFS)
$FTP ->Cd("/pub");
remote host.
Win32::GetTickCount()
MAXCOMPLEN is the maximum length of a filename component (the part
Returns the number of milliseconds elapsed since the last system boot.
Deletes a file on the FTP remote host.
between two backslashes) on this file system.
$FTP ->Delete("yourfile.zip");
Gets the remote FTP file and saves it.
$FTP ->Get("myfile.zip");
Win32::GetOSVersion()
Upload a file to the server.
Win32::GetChipName()
Returns the array (STRING, MAJOR, MINOR, BUILD, ID), where the
$FTP ->Put("newfile.zip");
Returns the processor type: 386, 486 or 586 for Intel processors, 21064 for the
elements are, respectively: An arbitrary descriptive string, the major version
Alpha chip.
Returns a list containing the files in
number of the operating system, the minor version number, the build number,
@files = $FTP ->List("*.txt");
current directory.
and a digit indicating the actual operating system. For ID, the values are 0 for
Win32s, 1 for Windows 9X and 2 for Windows NT. In scalar context it
Creates a directory on the FTP remote
Win32::Sleep(TIME)
$FTP ->Mkdir("NextBuild");
returns just the ID.
Pauses for TIME milliseconds. The timeslices are made available to other
host.
processes and threads.
Returns the current directory on the FTP
$path = $FTP ->Pwd();
server.

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 4