Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Microsoft Win32 Internet Programmer

Microsoft Win32 Internet Programmer

Ratings: (0)|Views: 173 |Likes:
Published by api-3767556

More info:

Published by: api-3767556 on Oct 16, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

Microsoft Win32 Internet Programmer's Reference
FTP Functions
The FTP functions deal with FTP file and directory manipulation and navigation.
FtpCreateDirectory

BOOL FtpCreateDirectory(
IN HINTERNET hFtpSession,
IN LPCTSTR lpszDirectory

);
Creates a new directory on the FTP server.
\u2022
Returns TRUE if successful, or FALSE otherwise. To get a specific error code, call
GetLastError. If the error code indicates that the FTP server denied the request to create
a directory, useInternetGe tLastResp onseInf o to determine why.
hFtpSession
Valid handle to an FTP session.
lpszDirectory

Address of a null-terminated string that contains the name of the directory to create on the remote system. This can be either a fully qualified path name or a name relative to the current directory.

An application should useFtpGetCurrentDi rectory to determine the remote site's current working
directory, instead of assuming that the remote system uses a hierarchical naming scheme for
directories.

Thelps zDirectory parameter can be either partially or fully qualified file names relative to the
current directory. A backslash (\) or forward slash (/) can be used as the directory separator for
either name. TheFtpCreateDirector y function translates the directory name separators to the
appropriate character before they are used.

FtpDeleteFile

BOOL FtpDeleteFile(
IN HINTERNET hFtpSession,
IN LPCTSTR lpszFileName

);
Deletes a file stored on the FTP server.
\u2022
Returns TRUE if successful, or FALSE otherwise. To get a specific error code, call
GetLastError.
hFtpSession
Valid handle to an FTP session.
lpszFileName
Address of a null-terminated string that contains the name of the file to delete on the
remote system.

Thelps zFile parameter can be either partially or fully qualified file names relative to the current directory. A backslash (\) or forward slash (/) can be used as the directory separator for either name. TheFtp DeleteFile function translates the directory name separators to the appropriate character before they are used.

FtpFindFirstFile

HINTERNET FtpFindFirstFile(
IN HINTERNET hFtpSession,
IN LPCTSTR lpszSearchFile OPTIONAL,
OUT LPWIN32_FIND_DATA lpFindFileData,
IN DWORD dwFlags
IN DWORD dwContext

);
Searches the specified directory of the given FTP session. File and directory entries are returned
to the application in theWIN32_FIND_D ATA structure.
\u2022

Returns a valid handle for the request if the directory enumeration was started
successfully; otherwise, returns NULL. To get a specific error code, callGetLastError. If
the function finds no matching files,GetLastError returns ERROR_NO_MORE_FILES.

hFtpSession
Valid handle to an FTP session returned fromInternetCon nect.
lpszSearchFile

Address of a null-terminated string that specifies a valid directory path name or file name for the FTP server's file system. If the value oflps zSearchFile is NULL or if it is an empty string, it will find the first file in the current directory on the server.

lpFindFileData
Address of aWIN32_FIND_D ATA structure that receives information about the found file
or directory.
dwFlagsApplication-defined value that associates this search with any application. For a
description of the values, seeInternetOpenUr l.
dwContext

An application-defined value that associates this search with any application data. This parameter is used only if the application has already calledInternetSetSt atusCallback to set up a status callback function.

This function enumerates both files and directories.

TheFtpFindFirstFile function is similar to the Win32FindFirstFil e function. Note, however, that
only oneFtpFindFirstFile can occur at a time within a given FTP session. The enumerations,
therefore, are correlated with the FTP session handle. This is because the FTP protocol allows
only a single directory enumeration per session.

After callingFtpFindFirstFile and until callingInternetCloseHa ndle, the application cannot call
FtpFindFirstFile again on a given FTP session handle. If this happens, calls to the
FtpFindFirstFile function will fail with error code ERROR_FTP_TRANSFER_IN_PROGRESS.
After beginning a directory enumeration withFtpFindFirstFile, theInternetFindNextFile function
can be used to continue the enumeration.

TheInternetCloseHa ndle function is used to close the handle returned fromFtpFindFirstFile. If
theInternetClos eHandle function closes the handle beforeInternetFin dNextFi le fails with
ERROR_NO_MORE_FILES, the directory enumeration will be terminated.

Because the FTP protocol provides no standard means of enumerating, some of the common
information about files, such as file creation date and time, is not always available or correct.
When this happens,FtpFindFirstFile andInternetFindNextFile fill in unavailable information with
a "best guess" based on available information. For example, creation and last access dates will
often be the same as the file's modification date.

The application cannot callFtpFindFirstFile between calls toFtpOpenFile and
InternetCloseHandle.
See alsoFtpOpenFile,InternetClos eHandle,InternetFin dNextFi le,InternetSetSt atusCallback
FtpGetCurrentDirectory

BOOL FtpGetCurrentDirectory(
IN HINTERNET hFtpSession,
OUT LPCTSTR lpszCurrentDirectory,
IN OUT LPDWORD lpdwCurrentDirectory

);
Retrieves the current directory for the specified FTP session.
\u2022
Returns TRUE if successful, or FALSE otherwise. To get the specific error code, call
GetLastError. If the error code indicates that the FTP server denied the request to
change to a directory, useInternetGetLastRes ponseInfo to determine why.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->