salvageerasedfile

Recovers a file that has been marked for deletion.

Library:LibC
Classification:Novell
Service:File and Directory I/O

Syntax

  #include <fsio.h> 
   
  int salvageerasedfile (
     const char   *pathName,
     long          sequence,
     const char   *newFileName );
  

Parameters

pathName

(IN) Points to the string containing the path name of the erased file to be salvaged.

sequence

(IN) Uniquely identifies the file to salvage.

newFileName

(IN) Points to a null-terminated string containing the name to give the erased file when it is restored. The string is the filename only and cannot contain volume or directory components.

Return Values

If successful, returns 0. Otherwise, returns -1 and sets errno.

Decimal

Constant

Description

9

EINVAL

The path or filename is invalid.

79

ENOTSUP

The operation is not supported on the specified file system.

105

ENOCONTEXT

The calling thread has no context.

Remarks

A file marked for deletion with a function such as remove can be recovered by calling the salvageerasedfile function.The pathname parameter can be an absolute path with a volume name, or it can be relative to the current working directory.

The sequence parameter is obtained from the scanerasedfiles function.

The caller must have Create rights in the specified directory.

See Also