cygwin+subst issue
| #include <fcntl.h> | |
| #include <unistd.h> | |
| #include <errno.h> | |
| #include <stdio.h> | |
| int main() { | |
| const char const* fn = "foo"; | |
| int handle1, handle2, res; | |
| handle1 = open(fn, O_RDONLY | O_CREAT); | |
| if (handle1 == -1) { | |
| perror("open #1"); | |
| } | |
| res = unlink(fn); | |
| if (res == -1) { | |
| perror("unlink"); | |
| } | |
| handle2 = open(fn, O_WRONLY | O_CREAT); | |
| if (handle2 == -1) { | |
| perror("open #2"); | |
| } | |
| close(handle2); | |
| close(handle1); | |
| return 0; | |
| } |
| #!/usr/bin/bash | |
| touch foo | |
| { rm foo; touch foo; } <foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment