CWB
Functions

fileutils.h File Reference

#include <sys/types.h>
#include "globals.h"

Functions


Function Documentation

off_t fd_file_length ( FILE *  fd)

Gets the size of the specified file; returns EOF for error.

As file_length, but the file is specified by file handle, not name.

Parameters:
fdThe file to size up.
Returns:
Size of file in bytes.
off_t fi_file_length ( int  fileno)

Gets the size of the specified file; returns EOF for error.

As file_length, but the file is specified by number, not name.

See also:
file_length
Parameters:
filenoThe file to size up.
Returns:
Size of file in bytes.
off_t file_length ( char *  filename)

Gets the size of the specified file; returns EOF for error.

Parameters:
filenameThe file to size up.
Returns:
Size of file in bytes.

Referenced by attach_subcorpus(), comp_component_state(), and nqrfile_print_info().

long fprobe ( char *  fname)

Gets the size of the specified file; returns EOF for error.

Duplicates functionality of file_length, but return is long instead of off_t.

See also:
file_length
Parameters:
fnameThe file to size up.
Returns:
Size of file in bytes.
int is_directory ( char *  path)

Checks whether the specified path indicates a directory.

Parameters:
pathPath to check.
Returns:
Boolean. (Also false if there's an error.)

Referenced by makeall_do_attribute().

int is_file ( char *  path)

Checks whether the specified path indicates a regular file.

Parameters:
pathPath to check.
Returns:
Boolean. (Also false if there's an error.)
int is_link ( char *  path)

Checks whether the specified path indicates a link.

Note this function always returns false in Windows, because Windows doesn't have Unix-style links. (.lnk files don't count.)

Parameters:
pathPath to check.
Returns:
Boolean. (Also false if there's an error.)