Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
26d33232
Commit
26d33232
authored
Dec 13, 2016
by
Guolin Ke
Browse files
bug fixed in save binary file
parent
918c157b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
src/io/dataset.cpp
src/io/dataset.cpp
+7
-6
No files found.
src/io/dataset.cpp
View file @
26d33232
...
@@ -131,6 +131,13 @@ bool Dataset::GetIntField(const char* field_name, int64_t* out_len, const int**
...
@@ -131,6 +131,13 @@ bool Dataset::GetIntField(const char* field_name, int64_t* out_len, const int**
}
}
void
Dataset
::
SaveBinaryFile
(
const
char
*
bin_filename
)
{
void
Dataset
::
SaveBinaryFile
(
const
char
*
bin_filename
)
{
// if not pass a filename, just append ".bin" of original file
if
(
bin_filename
==
nullptr
||
bin_filename
[
0
]
==
'\0'
)
{
std
::
string
bin_filename_str
(
data_filename_
);
bin_filename_str
.
append
(
".bin"
);
bin_filename
=
bin_filename_str
.
c_str
();
}
bool
is_file_existed
=
false
;
bool
is_file_existed
=
false
;
FILE
*
file
;
FILE
*
file
;
#ifdef _MSC_VER
#ifdef _MSC_VER
...
@@ -146,12 +153,6 @@ void Dataset::SaveBinaryFile(const char* bin_filename) {
...
@@ -146,12 +153,6 @@ void Dataset::SaveBinaryFile(const char* bin_filename) {
}
}
if
(
!
is_file_existed
)
{
if
(
!
is_file_existed
)
{
std
::
string
bin_filename_str
(
data_filename_
);
// if not pass a filename, just append ".bin" of original file
if
(
bin_filename
==
nullptr
||
bin_filename
[
0
]
==
'\0'
)
{
bin_filename_str
.
append
(
".bin"
);
bin_filename
=
bin_filename_str
.
c_str
();
}
#ifdef _MSC_VER
#ifdef _MSC_VER
fopen_s
(
&
file
,
bin_filename
,
"wb"
);
fopen_s
(
&
file
,
bin_filename
,
"wb"
);
#else
#else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment