/usr/include/wvstreams/wvpushdir.h is in libwvstreams-dev 4.6.1-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | /* -*- Mode: C++ -*-
* Worldvisions Tunnel Vision Software:
* Copyright (C) 1997-2002 Net Integration Technologies, Inc.
*
* WvPushDir -- A simple class to check the existance of a dir
* and to properly return the formatted path of the diir
*/
#ifndef __WVPUSHDIR_H
#define __WVPUSHDIR_H
#include "wverror.h"
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
class WvPushDir : public WvError
{
DIR *dir_handle;
char *old_dir;
public:
void* operator new(size_t)
{ abort(); }
WvPushDir(WvStringParm new_dir)
{
#ifdef MACOS
old_dir = static_cast<char *>(calloc(PATH_MAX, sizeof(char *)));
getcwd(old_dir, PATH_MAX);;
#else
old_dir = get_current_dir_name();
#endif
dir_handle = opendir(old_dir);
if (chdir(new_dir) == -1)
errnum = errno;
}
~WvPushDir()
{
chdir(old_dir);
closedir(dir_handle);
free(old_dir);
}
};
#endif /// __WVPUSHDIR_H
|