Jump to content


Photo

AttributeBits, ValidAttributeBits, etc.


  • Please log in to reply
1 reply to this topic

#1 2BrightSparks

2BrightSparks
  • Members
  • 44 posts
  • Gender:
    Male

Posted 03 January 2011 - 01:07 PM

At the moment I'm upgrading from V1.5 to V2 and am confused about the attribute bits settings in the new V2. Using SFTP, could you give me an example of setting a files last modification date & time and also how to remove a read-only attribute from a file? Previously I used AttributeBits, ValidAttributes, and ValidAttributeBits, but now I see that ValidAttributes no longer exists, and neither do the definitions like ftpSFTPItemAttributeBitReadOnly etc.

Thanks

#2 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 03 January 2011 - 02:37 PM

>setting last modification time
Create new SFTPItem:
CComPtr<sfFTPLib::ISFTPItem> pItem;
pItem.CoCreateInstance(__uuidof(sfFTPLib::SFTPItem));
Set LastModifyTime
pItem->ModifyTimeAsFileTime = FILETIME;
pSFTPConnection->SetStat("path", pItem)

To check if an attribute exists use IsValidAttribute.
pItem->IsValidAttribute(sfFTPLib::ftpSFTPItemAttributeBits)

>ftpSFTPItemAttributeBitReadOnly etc
Please install the newest version.

>To remove attributebitreadonly
Create new SFTPItem
pNewItem->AttributeBits = pItem->AttributeBits & ~sfFTPLib::ftpSFTPItemAttributeBitReadOnly;
SetStat("path", pNewItem);




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users