-# Test for trying to create a file in a non-exist directory
-my $rand_path = "";
-do {
- my @chars = ("A".."Z", "a".."z", "0".."9");
- $rand_path .= $chars[rand @chars] for 1..32;
-} while (-d File::Spec->catdir('.', $rand_path));
-$rand_path .= "/randomname.bin";
+# Test 1
+SKIP: {
+ # Paths that should generate failure when trying to write to them.
+ # Directories are a safe bet for failure on most platforms.
+ # Notably, this isn't true on OpenVMS, as a default file name is
+ # appended under the hood when trying to "write" to a directory spec.
+ # From observation, that file is '.' (i.e. a file with no file name
+ # and no extension), so '[]' gets translated to '[].'
+ skip 'Directories become writable files on OpenVMS', 1 if $^O eq 'VMS';