finish python lib

This commit is contained in:
tqchen
2014-05-03 22:18:25 -07:00
parent 140499ac9e
commit 65917bb831
8 changed files with 231 additions and 32 deletions

View File

@@ -31,7 +31,7 @@ namespace xgboost{
/*! \brief load feature map from text format */
inline void LoadText(FILE *fi){
int fid;
char fname[256], ftype[256];
char fname[1256], ftype[1256];
while (fscanf(fi, "%d\t%[^\t]\t%s\n", &fid, fname, ftype) == 3){
utils::Assert(fid == (int)names_.size(), "invalid fmap format");
names_.push_back(std::string(fname));

View File

@@ -38,6 +38,7 @@ namespace xgboost{
namespace utils{
inline void Error(const char *msg){
fprintf(stderr, "Error:%s\n", msg);
fflush(stderr);
exit(-1);
}
@@ -57,7 +58,8 @@ namespace xgboost{
inline FILE *FopenCheck(const char *fname, const char *flag){
FILE *fp = fopen64(fname, flag);
if (fp == NULL){
fprintf(stderr, "can not open file \"%s\"\n", fname);
fprintf(stderr, "can not open file \"%s\" \n", fname);
fflush(stderr);
exit(-1);
}
return fp;