SetFileSize Method

Sets the size of a file or alternate stream.

Syntax

ANSI (Cross Platform)
int SetFileSize(const char* lpszFileName, int64 lSize, const char* lpszPassword);

Unicode (Windows)
INT SetFileSize(LPCWSTR lpszFileName, LONG64 lSize, LPCWSTR lpszPassword);
- (void)setFileSize:(NSString*)fileName :(long long)size :(NSString*)password;
#define MID_CBVAULT_SETFILESIZE 65

CBFSSTORAGE_EXTERNAL int CBFSSTORAGE_CALL CBFSStorage_CBVault_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method sets the size of the file or alternate stream specified by FileName.

The value passed for FileName must be a vault-local absolute path.

The Size parameter specifies the new size of the file or alternate stream, which must be greater than or equal to 0.

Applications can also change the size of a file or alternate stream using the stream objects returned by the OpenFile and OpenFileEx methods.

Note: This method can only be called when Active is true, and cannot be called within events.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2021 Callback Technologies, Inc. - All rights reserved.
CBFS Storage 2020 C++ Edition - Version 20.0 [Build 8031]