Last active
August 29, 2015 14:11
-
-
Save elieux/6463521192baed613099 to your computer and use it in GitHub Desktop.
cygwin+subst issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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