| 121 | */ |
| 122 | #undef creat |
| 123 | int |
| 124 | vms_creat(const char *file, unsigned int mode) |
| 125 | { |
| 126 | char filnambuf[BUFSIZ]; /*(not BUFSZ)*/ |
| 127 | |
| 128 | if (strchr(file, ';')) { |
| 129 | /* assumes remove or delete, not vms_unlink */ |
| 130 | if (!unlink(file)) { |
| 131 | (void) sleep(1); |
| 132 | (void) unlink(file); |
| 133 | } |
| 134 | } else if (!strchr(file, '.')) { |
| 135 | /* force some punctuation to be present */ |
| 136 | file = strcat(strcpy(filnambuf, file), "."); |
| 137 | } |
| 138 | return creat(file, mode, "shr=nil", "mbc=32", "mbf=2", "rop=wbh"); |
| 139 | } |
| 140 | |
| 141 | /* |
| 142 | Similar substitute for open() -- if an open attempt fails due to being |