This code demonstrates how to scan erased files in a directory with ScanErasedFiles()
#include <nwfile.h>
#include <nwfinfo.h>
#include <stdio.h>
#include <stdlib.h>
int main( int argc, char* argv[]) {
long nextEntryNumber = -1;
static DIR deletedFileInfo;
if ( argc != 2) {
printf( "Syntax: %s <dir_name>\n", argv[ 0]);
return EXIT_FAILURE;
}
while ( ScanErasedFiles( argv[ 1],
&nextEntryNumber,
&deletedFileInfo) == 0) {
puts( deletedFileInfo.d_name);
}
return EXIT_SUCCESS;
}
© 2008 Novell, Inc. All Rights Reserved.