next up previous contents index
Next: ScanDir Class Up: Utility Classes Previous: SortedObjectTable Class

FileStat Class

 


  
Figure 3.4: FileStat Class
\begin{figure}
\begin{center}

\includegraphics [scale=1]{FileStat.ps}
\end{center}\end{figure}

The FileStat class (See Figure 3.4) is the wrapper class for the stat() system call, which obtains various information on an entry of file systems from the operating system.

The class is instantiated with a path name as the parameter. The constructor calls the stat() together with the geteuid() and the getegid().

The operation restat() updates the information on the entry by calling the stat() again.

There are some self-explanatory accessors. The accessor exists() returns True if the entry exists. The accessor getSize() returns the size of the entry. The other accessors - isRegularFile(), isDirectory(), isReadable(), isWritable(), and isExecutable() - function as their names indicate. The results of the last three accessors consults the effective user id and the effective group id as well as the access permissions of the entry.



 

Mori Tetsuya / t2y3141592@gmail.com