Recalls a file from storage media that Remote Storage manages, which is the hierarchical storage management software.
To recall a file, call the DeviceIoControl function with the following parameters.
BOOL DeviceIoControl( (HANDLE) hDevice, // handle to file or directory FSCTL_RECALL_FILE, // dwIoControlCodeNULL, // lpInBuffer0, // nInBufferSizeNULL, // lpOutBuffer0, // nOutBufferSize(LPDWORD) lpBytesReturned, // number of bytes returned (LPOVERLAPPED) lpOverlapped // OVERLAPPED structure );
Input Buffer Length
Output Buffer Length
Input / Output Buffer
Input / Output Buffer Length
Irp->IoStatus.Status is set to STATUS_SUCCESS if the request is successful.
Otherwise, Status to the appropriate error condition as a NTSTATUS code.
For more information, see NTSTATUS Values.
FSCTL_RECALL_FILE recovers a file from storage, for example, a tape that is managed by Remote Storage. If the file is already cached locally, this operation does nothing. Similarly, if the file has not been moved to remote storage, this operation does nothing.
FSCTL_RECALL_FILE operates only on systems where Remote Storage is installed. If Remote Storage is not installed, the operation fails and GetLastError returns the error code ERROR_INVALID_FUNCTION.
Directories cannot be moved to remote storage. Calling FSCTL_RECALL_FILE for a directory fails, and GetLastError returns the error code ERROR_INVALID_HANDLE.
Typically, files that are stored on media that is managed by Remote Storage are recalled when an application attempts to make the first access to data. An application that opens a file without immediately accessing the data can speed up the first access by using FSCTL_RECALL_FILE immediately after opening the file. However, avoid indiscriminate recall of files that an application does not touch.
Before you call FSCTL_RECALL_FILE you do not need to test a file's attributes for the flag FILE_ATTRIBUTE_OFFLINE with the function GetFileAttributes. The test is unnecessary because an online file is not affected by this operation. However, any operating system call takes processor time. To conserve processor time, call GetFileAttributes to check file attributes to determine if FSCTL_RECALL_FILE is necessary.
For the implications of overlapped I/O on this operation, see the Remarks section of the DeviceIoControl topic.
In Windows 8 and Windows Server 2012, this code is supported by the following technologies.
|Server Message Block (SMB) 3.0 protocol||No|
|SMB 3.0 Transparent Failover (TFO)||No|
|SMB 3.0 with Scale-out File Shares (SO)||No|
|Cluster Shared Volume File System (CsvFS)||No|
|Resilient File System (ReFS)||Yes|
The following code example is a command-line utility that recalls one or more files indicated on the command line from remote storage.
#include <Windows.h> #include <malloc.h> #include <stdio.h> #include <WinIoCtl.h>
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|
|Header||winioctl.h (include Windows.h)|