Getting out from Cygwin path in C

Viewed 32

I'm new in programming. I just want to get out the Cygdrive to be able to execute commands outside /cygdrive/c.

My code:

#include <unistd.h>
#include <stdio.h>

int main(){
    if(remove("test.txt") == 0){

        printf("Removed succesfully.");
    }

    return 0;

And I get the file removed, but just inside my Proyect folder. What I need is to get 'test.txt' file deleted in any of the paths I want.

Example:

#include <unistd.h>
#include <stdio.h>

int main(){

    chdir("C:\\\\Windows\\\\system32");

    if(remove("test.txt") == 0){

        printf("Removed succesfully.");
    }

    return 0;
1 Answers

Changing from cygwin to MinGW solved the problem.

Related