stat

Retrieves the status of a specified file or directory

Local Servers:blocking
Remote Servers:blocking
Classification:POSIX
Platform:NLM
Service:File System

Syntax

   #include <stat.h>  
    
   int stat  (  
      const char   *path,   
      struct stat  *statblk);
   

Parameters

path

(IN) Points to a string containing the path of the directory or file for which status is to be obtained (maximum 255 characters, including the NULL terminator).

statblk

(OUT) Points to the stat containing information about the file.

Return Values

Returns a value of 0 when the information is successfully obtained. Otherwise, a value of -1 is returned and errno is set to indicate the type of error that occurred.

Remarks

stat (Function) returns information in the stat (Structure) located at the address indicated by the statblk parameter.

The SYS\STAT.H header file contains definitions for the stat (Structure) and describes the contents of the fields.

The time and date in the stat (Structure) are in calendar format.

Beginning with Release 9 of the NW SDK, stat (Function) returns long names in the d_name field of the stat (Structure) if the st_name field is set to something other than DOS. You must compile with the stat.h file included with Release 9 or later and link with the new nwpre.obj and is valid only when calling stat (Function) on the local server.

The current connection must have See File rights.

The SetCurrentNameSpace function sets the name space which is used for parsing the path input to stat (Function).

NOTE:For NetWare versions before 4.x, stat (Function) works only with the DOS name space for remote servers.

See Also

fstat (Single and Intra-File Services)