Unfortunately std::ifstream and std::ofstream are allowed to fail in unobvious ways when given a duff file. In particular, gcc won't error out when a std::ifstream is created for a directory until the first read occurs. So we write our own stream buffer classes that do error checking and throw useful exceptions on error, and use those instead.
14 lines
275 B
Bash
Executable File
14 lines
275 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# vim: set ft=sh sw=4 sts=4 et :
|
|
|
|
mkdir safe_ofstream_TEST_dir || exit 2
|
|
cd safe_ofstream_TEST_dir || exit 3
|
|
|
|
touch existing
|
|
mkdir existing_dir
|
|
touch existing_sym_target
|
|
ln -s existing_sym_target existing_sym
|
|
touch existing_perm
|
|
chmod a-rw existing_perm
|
|
|