zfile(3)

zfile(3)

CZMQ Manual - CZMQ/1.4.1

Name

zfile - helper functions for working with files.

Synopsis

//  Return 1 if file exists, else zero
CZMQ_EXPORT bool
    zfile_exists (const char *filename);

//  Return size of file, or -1 if not found
CZMQ_EXPORT ssize_t
    zfile_size (const char *filename);

//  Return file mode
CZMQ_EXPORT mode_t
    zfile_mode (const char *filename);

//  Delete file. Does not complain if the file is absent
CZMQ_EXPORT int
    zfile_delete (const char *filename);

//  Check if file is 'stable'
CZMQ_EXPORT bool
    zfile_stable (const char *filename);

//  Create a file path if it doesn't exit
CZMQ_EXPORT int
    zfile_mkdir (const char *pathname);

//  Remove a file path if empty
CZMQ_EXPORT int
    zfile_rmdir (const char *pathname);

//  Self test of this class
CZMQ_EXPORT int
    zfile_test (bool verbose);

Description

The zfile class provides methods to work with files and directories.

Example

From zfile_test method

 int rc = zfile_delete ("nosuchfile");
 assert (rc == -1);

 bool rc_bool = zfile_exists ("nosuchfile");
 assert (rc_bool != true);

 rc = (int) zfile_size ("nosuchfile");  assert (rc == -1);

See also

czmq(7)

Authors

The CZMQ manual was written by Pieter Hintjens<moc.xitami|hp#moc.xitami|hp>.

Resources

Main web site: http://czmq.zeromq.org/

Report bugs to the ØMQ development mailing list: <gro.qmorez.stsil|ved-qmorez#gro.qmorez.stsil|ved-qmorez>

Copyright

Copyright (c) 1991-2010 iMatix Corporation and contributors. License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>. This is free software: you are free to change it and redistribute it. There is NO WARRANTY, to the extent permitted by law. For details see the files COPYING and COPYING.LESSER included with the CZMQ distribution.