Shoot me if I'm wrong but I can't find any concord information about this!
How on earth will I be able to create a file in a directory relative to the program directory? I've tried a million different ways, like defining a prefix string, putting the directory in the line where info_filename is created, or in the line where test_info is opened... none of them seem to work. Find the snippets below:
So I would like the txt and dat file to be created inside the directory test_files.Code:now = time(NULL); struct tm *t = localtime(&now); mkdir("test_files"); strftime(info_filename, sizeof(info_filename), "i_%d%m%y_%H%M%S.txt", t); strftime(data_filename, sizeof(data_filename), "d_%d%m%y_%H%M%S.dat", t); test_info = fopen(info_filename, "w"); CAN_data = fopen(data_filename, "w");
Hope someone can help me out here! Thanks very much for any input.