use g_fopen()
git-svn-id: svn://localhost/ardour2/branches/3.0@11670 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
d46acb86ea
commit
0eb97bcae7
@ -47,6 +47,9 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
#include <glib/gstdio.h>
|
||||||
|
|
||||||
#include "ardour/audio_library.h"
|
#include "ardour/audio_library.h"
|
||||||
|
|
||||||
static const std::string base_url = "http://www.freesound.org/api";
|
static const std::string base_url = "http://www.freesound.org/api";
|
||||||
@ -305,7 +308,7 @@ std::string Mootcher::getAudioFile(std::string originalFileName, std::string ID,
|
|||||||
std::string audioFileName = basePath + "snd/" + ID + "-" + originalFileName;
|
std::string audioFileName = basePath + "snd/" + ID + "-" + originalFileName;
|
||||||
|
|
||||||
// check to see if audio file already exists
|
// check to see if audio file already exists
|
||||||
FILE *testFile = fopen(audioFileName.c_str(), "r");
|
FILE *testFile = g_fopen(audioFileName.c_str(), "r");
|
||||||
if (testFile) {
|
if (testFile) {
|
||||||
fseek (testFile , 0 , SEEK_END);
|
fseek (testFile , 0 , SEEK_END);
|
||||||
if (ftell (testFile) > 256) {
|
if (ftell (testFile) > 256) {
|
||||||
@ -325,7 +328,7 @@ std::string Mootcher::getAudioFile(std::string originalFileName, std::string ID,
|
|||||||
|
|
||||||
//now download the actual file
|
//now download the actual file
|
||||||
FILE* theFile;
|
FILE* theFile;
|
||||||
theFile = fopen( audioFileName.c_str(), "wb" );
|
theFile = g_fopen( audioFileName.c_str(), "wb" );
|
||||||
|
|
||||||
if (!theFile) {
|
if (!theFile) {
|
||||||
return "";
|
return "";
|
||||||
|
Loading…
Reference in New Issue
Block a user