Hi all,
I have a question about file path in lunix.
Since i pretty new to linux (im running ubuntu) i dont know how to give a correct file path to fopen command.
I want to write some data to a usb drive. Let me show you how i would do it in windows:
FILE *file;
file = fopen("j:\\test.txt", "w");
fprintf(file,"some Data");
fclose(file);
Where j: is my usb drive.
How can i do the same in ubuntu?
I know how i can write to my home dir:
const char filepath[] =
"/home/alexander/file.txt";
file = fopen(filepath,"a+");
But i cant figure it out how i can write to a usb drive or another hdd.
can anyone help me out here?
thanks,
Alex