Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Adds a file to the file system image.
Syntax
HRESULT AddFile(
  [in] BSTR    path,
  [in] IStream *fileData
);
Parameters
[in] path
String that contains the relative path of the directory to contain the new file.
Specify the full path when calling this method from the root directory item.
[in] fileData
An IStream interface of the file (data stream) to write to the media.
Return value
S_OK is returned on success, but other success codes may be returned as a result of implementation. The following error codes are commonly returned on operation failure, but do not represent the only possible error values:
| Return code | Description | 
|---|---|
| 
 | Path '%1!s!' is badly formed or contains invalid characters. Value: 0xC0AAB110 | 
| 
 | Pointer is not valid. Value: 0x80004003 | 
| 
 | The value specified for parameter %1!ls! is not valid. Value: 0xC0AAB101 | 
| 
 | ls!' is not part of the file system. It must be added to complete this operation. Value: 0xC0AAB10B | 
| 
 | FileSystemImage object is in read only mode. Value: 0xC0AAB102 | 
Remarks
The directory that will contain the new file must already exist within the file system image.
Requirements
| Requirement | Value | 
|---|---|
| Minimum supported client | Windows Vista, Windows XP with SP2 [desktop apps only] | 
| Minimum supported server | Windows Server 2003 [desktop apps only] | 
| Target Platform | Windows | 
| Header | imapi2fs.h |