use Test::More;
plan tests => 4;
chdir($_point);
-system("echo frog >file");
+open($file, '>', 'file');
+print $file "frog\n";
+close($file);
ok(chmod(0644,"file"),"set unexecutable");
ok(!-x "file","unexecutable");
ok(chmod(0755,"file"),"set executable");
my (@stat);
chdir($_point);
-system("echo frog >file");
+open($file, '>', 'file');
+print $file "frog\n";
+close($file);
SKIP: {
skip('Need root to give away ownership', 4) unless ($UID == 0);
chdir($_real);
# create entries
-map { system("touch \"$_\"") } @names;
+foreach $fname (@names) {
+ open($file, '>', $fname);
+ close($file);
+}
# make sure they exist in real dir
opendir(REAL,$_real);
use Test::More;
plan tests => 8;
chdir($_point);
-system("echo hippity >womble");
+open($file, '>', 'womble');
+print $file "hippity\n";
+close($file);
ok(-f "womble","exists");
ok(!-f "rabbit","target file doesn't exist");
is(-s "womble",8,"right size");
plan tests => 24;
use English;
use Unix::Mknod qw(:all);
-use Fcntl qw(:mode);
+use Fcntl qw(S_IFCHR S_IFBLK);
use POSIX;
my (@stat);
chdir($_point);
-ok(!(system("touch reg" )>>8),"create normal file");
+ok(open($file, '>', 'reg'),"create normal file");
+close($file);
ok(defined mkfifo($_point.'/fifo', 0600),"create fifo");
chdir($_real);
use Test::More;
plan tests => 1;
chdir($_real);
-system("echo frog >file");
+open($file, '>', 'file');
+print $file "frog\n";
+close($file);
chdir($_point);
ok(open(FILE,"file"),"open");
close(FILE);
use Test::More;
plan tests => 3;
chdir($_real);
-system("echo frog >file");
+open($file, '>','file');
+print $file "frog\n";
+close($file);
chdir($_point);
ok(open(FILE,"file"),"open");
my ($data) = <FILE>;
use Test::More;
plan tests => 5;
chdir($_point);
-system("echo hippity >frog");
+open($file, '>', 'frog');
+print $file "hippity\n";
+close($file);
ok(-f "frog","exists");
ok(!-f "toad","target file doesn't exist");
ok(rename("frog","toad"),"rename");
# bug: doing a 'cp -a' on a directory which contains a symlink
# reports an error
mkdir("dira");
-system("cd dira; touch filea; ln -s filea fileb");
+open($file, '>', 'dira/filea');
+close($file);
+symlink('filea', 'dira/fileb');
my $cp = 'cp -a';
if ($^O eq 'netbsd') { $cp = 'cp -R'; }
is(system($cp . " dira dirb")>>8,0,$cp);
-system("rm -rf dira dirb");
+map { unlink($_) } ('dira/filea', 'dira/fileb', 'dirb/filea', 'dirb/fileb');
+map { rmdir($_) } ('dira', 'dirb');
use Test::More;
plan tests => 5;
chdir($_point);
-system("echo hippity >womble");
+open($file, '>', 'womble');
+print $file "hippity\n";
+close($file);
ok(-f "womble","exists");
is(-s "womble",8,"right size");
ok(truncate("womble",4),"truncate");
use Test::More;
plan tests => 4;
chdir($_point);
-system("touch file");
+open($file, '>', 'file');
+close($file);
ok(-f "file","file exists");
chdir($_real);
ok(-f "file","file really exists");
plan tests => 3;
my (@stat);
chdir($_real);
-system("echo frog >file");
+open($file, '>', 'file');
+print($file "frog\n");
+close($file);
chdir($_point);
ok(utime(1,2,"file"),"set utime");
@stat = stat("file");
chdir($_point);
undef $/; # slurp it all
# create file
-system("echo frogbing >writefile");
+open($file, '>', 'writefile');
+print $file "frogbing\n";
+close($file);
# fetch contents of file
ok(open(FILE,"writefile"),"open");