<< Back
// FVSDK_FileInfo.h : header file FTP Voyager Software Development Kit file information
//
// Copyright © 1997-2008 - Rhino Software, Inc.
// FTP Voyager® is a registered trademark of Rhino Software, Inc.
// http://www.RhinoSoft.com/
//
// Author:  Mark P. Peterson
// Date:    August 19, 2005
//
// You are free to use/modify this code but leave this header intact.
// FTP Voyager, the FTP Voyager Software Development Kit, and FtpTree ActiveX
// Control are not public domain.  Any registration IDs or non-public domain
// software from Rhino Software, Inc. remains copyrighted.  For more information
// refer to the license agreement distributed with the FTP Voyager SDK.
//
// If you decide to use the FTP Voyager Software Development Kit, or FtpTree
// ActiveX control, you must first purchase a license.  For more information
// visit http://www.RhinoSoft.com/
//------------------------------------------------------------------------------

// prevent multiple inclusions of this file
#ifndef _FVSDK_FileInfo_HEADER
#define _FVSDK_FileInfo_HEADER

#include "FVSDK_ErrorCodes.h"

/////////////////////////////////////////////////////////////////////////////
// pack to one byte boundaries
#pragma pack(push)
#pragma pack(1)

/////////////////////////////////////////////////////////////////////////////
// version numbers
const UINT      FVSDK_FILE_INFO_VERSION_1           = 1;

// the current file info structure version
#define FVSDK_FILE_INFO_CURRENT_VERSION             FVSDK_FILE_INFO_VERSION_1

/////////////////////////////////////////////////////////////////////////////
// macros
#define FVSDK_MAX_FILE_NAME_SZ                      256
#define FVSDK_MAX_PERMS_SZ                          64
#define FVSDK_MAX_OWNER_SZ                          32
#define FVSDK_MAX_GROUP_SZ                          32
#define FVSDK_MAX_LINKED_TO_SZ                      FVSDK_MAX_FILE_NAME_SZ
#define FVSDK_MAX_TYPE_SZ                           16

/////////////////////////////////////////////////////////////////////////////
// typedefs
typedef ULONGLONG FVSDK_FILE_SIZE;

/////////////////////////////////////////////////////////////////////////////
// FVSDK_FileInfo structure

/*** FVSDK_FileInfo Structure Description ***

The FVSDK_FileInfo is used by FVSDK_FindNextFile() to return the information about the
current file being searched.  The first call to FVSDK_FindNextFile() returns the information
about the first file found in a directory.  The return value identifies whether another file
or directory exists.  Subsequent calls retrieve information for the next file in the listing,
with the return value always indicating whether more files exist.

Directory listings can be large.  Therefore it is not recommended to maintain an array of these
structures because this structure contains large strings for file names, permissions, etc.  Instead,
you should allocate the needed information in your own structures or objects.

*** End Description ***/

/*** BEGIN FVSDK_FileInfo ***/
typedef struct FVSDK_FileInfoStruct
{
    // administrative variables
    UINT                nSize;                                  // size, in bytes, of this structure
    UINT                nVersion;                               // version number of this structure; use the largest version number defined in FVSDK_FileInfo.h

    // attributes defining the file or folder
    char                pszFileName[FVSDK_MAX_FILE_NAME_SZ];    // the file name without the path
    BOOL                bDirectory;                             // TRUE if the item is a directory or folder

    // misc. UNIX style information
    BOOL                bSymbolicLink;                          // TRUE if the item is a UNIX symbolic link (could be a file or directory)
    char                pszPermissions[FVSDK_MAX_PERMS_SZ];     // if known, the file or directory permissions, usually in a UNIX style
    char                pszUser[FVSDK_MAX_OWNER_SZ];            // if known, the UNIX owner (or user) name
    char                pszGroup[FVSDK_MAX_GROUP_SZ];           // if known, the UNIX group
    char                pszLinkedTo[FVSDK_MAX_LINKED_TO_SZ];    // if known, the file or folder to which the symbolic link is linked

    // size
    FVSDK_FILE_SIZE     fsFileSize;                             // the size of the file in bytes
    BOOL                bSizeSet;                               // TRUE if the size element is set or known

    // date and time
    FVSDK_TIME          tmDateTime;                             // the date and time of the file or folder. The tm_wday, tm_yday, and tm_idst elements are not used
    BOOL                bDateSet;                               // TRUE if the date is set (or known) as part of the date and time element
    BOOL                bTimeSet;                               // TRUE if the time is set (or known) as part of the date and time element

    // misc.
    char                pszType[FVSDK_MAX_TYPE_SZ];             // the file type for AS400 servers

} FVSDK_FileInfo;
/*** END FVSDK_FileInfo ***/

// restore structure packing
#pragma pack(pop)

/////////////////////////////////////////////////////////////////////////////
#endif