NWRecoverDeletedFile(3nw)


NWRecoverDeletedFile -- recovers deleted files from NetWare server

Synopsis

   #include <nwdel.h> 
   or 
   #include <nwcalls.h> 
   

NWCCODE N_API NWRecoverDeletedFile (NWCONN_HANDLE conn, NWDIR_HANDLE dirHandle, nuint32 iterHandle, nuint32 volNum, nuint32 dirBase, pnstr8 delFileName, pnstr8 rcvrFileName);

Description

The parameters are as follows:

conn
(IN) Specifies the NetWare server connection handle containing the deleted file.

dirHandle
(IN) Specifies the directory handle of the directory containing the file to recover.

iterHandle
(IN) Specifies the number returned by NWScanForDeletedFiles (valid for 3.x and above only, use NULL for 2.x).

volNum
(IN) Specifies the number returned by NWScanForDeletedFiles (valid for 3.11 and above only, use NULL for 2.x).

dirBase
(IN) Specifies the number returned by NWScanForDeletedFiles (valid for 3.11 and above only, use NULL for 2.x).

delFileName
(IN/OUT) Points to the name of the erased file:
IN    3.0, 3.1 
OUT   2.x 

rcvrFileName
(IN/OUT) Points to the name to use in recovering the file.
IN    3.0, 3.1 
OUT   2.x 

Return values

0x0000
SUCCESSFUL

0x8801
INVALID_CONNECTION

0x8998
VOLUME_DOES_NOT_EXIST

0x899B
BAD_DIRECTORY_HANDLE

0x899C
INVALID_PATH

0x8984
NO_CREATE_PRIVILEGES

0x8996
SERVER_OUT_OF_MEMORY

0x89A1
DIRECTORY_IO_ERROR

0x89FD
BAD_STATION_NUMBER

0x89FE
File name already exists in this directory

0x89FF
Failure

Notices

NWRecoverDeletedFile replaces NWRecoverSalvageableFile and provides compatibility for 2.x and 3.x NetWare platforms. Due to compatibility, path previously used by NWRecoverSalvageableFile is no longer supported.

For 3.x-4.x servers, files deleted by a client are moved to a holding area on the volume until they are either purged, restored (by calling NWRecoverDeletedFile), or replaced by other deleted files.

For 3.11 servers, the recovery is performed one file at a time. NWRecoverDeletedFile can also recover the deleted file and give it a new name. This feature alleviates problems with recovering a file when a new file exists with the same name.

For 2.x servers, applications are unable to scan for the deleted file. Therefore, dirHandle must contain a handle pointing to the directory containing the deleted file. If a file with the same name already exists in that same directory, the server gives the recovered file a new name and returns it to the caller.

For 2.x servers, only the last deleted entry is recoverable. Also, this file is recoverable only until a client attempts another erase or file create request. NWScanForDeletedFiles returns all necessary information to be passed into NWRecoverDeletedFile.

For 2.x servers, the server returns delFileName(rather than passing it in). This buffer cannot be NULL.

A 2.x NetWare server returns the appropriate name for rcvrFileName. For 3.x, the application must specify the file name in rcvrFileName not the path; no wildcards are allowed.


NOTE: Due to earlier support for 14 character names in NetWare, both delFileName and rcvrFileName buffers must be at least 15 bytes long.

Although parameters may only be valid for some servers, each parameter must be filled. Valid parameters for NWRecoverDeletedFile on each platform are listed below:

2.x 3.0 and 3.1 3.11 and 4.0
conn conn conn
dirHandle dirHandle dirHandle
sequence iterHandle -
volNum - -
dirBase - -
deletedFileName(return) deletedFileName(passed in) -
recoverFileName(return) recoverFileName(passed in) rcvrFileName

 
 ----------------------------------------------------------------------------- 
| 2.x                    |  3.0 and 3.1               |  3.11 and 4.0        | 
|------------------------|----------------------------|----------------------| 
| conn                   |  conn                      |  conn                | 
|------------------------|----------------------------|----------------------| 
| dirHandle              |  dirHandle                 |  dirHandle           | 
|------------------------|----------------------------|----------------------| 
| sequence               |  iterHandle                |  -                   | 
|------------------------|----------------------------|----------------------| 
| volNum                 |  -                         |  -                   | 
|------------------------|----------------------------|----------------------| 
| dirBase                |  -                         |  -                   | 
|------------------------|----------------------------|----------------------| 
| deletedFileName(return)|  deletedFileName(passed in)|  -                   | 
|------------------------|----------------------------|----------------------| 
| recoverFileName(return)|  recoverFileName(passed in)|  rcvrFileName        | 
|------------------------|----------------------------|----------------------| 

Services

Deleted File

NCP calls

0x2222 22 17 Recover Erased File (old)
0x2222 22 28 Recover Salvageable File
0x2222 23 17 Get File Server Information
0x2222 87 17 Recover Salvageable File

 
 ----------------------------------------- 
| 0x2222|  22|  17|  Recover Erased File | 
|       |    |    |  (old)               | 
|-------|----|----|----------------------| 
| 0x2222|  22|  28|  Recover Salvageable | 
|       |    |    |  File                | 
|-------|----|----|----------------------| 
| 0x2222|  23|  17|  Get File Server     | 
|       |    |    |  Information         | 
|-------|----|----|----------------------| 
| 0x2222|  87|  17|  Recover Salvageable | 
|       |    |    |  File                | 
|-------|----|----|----------------------| 

References

NWScanForDeletedFiles(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.