- if ( (fd = ::open(file_name.c_str(),O_RDWR|O_CREAT,00666)) <0) {
- SALOME::ExceptionStruct es;
- es.type = SALOME::INTERNAL_ERROR;
- std::string text = "open failed";
- es.text = CORBA::string_dup(text.c_str());
- throw SALOME::SALOME_Exception(es);
- };
- hdf_dataset->ReadFromDisk(buffer);
- if ( write(fd,buffer,size) <0) {
- SALOME::ExceptionStruct es;
- es.type = SALOME::INTERNAL_ERROR;
- std::string text = "write failed";
- es.text = CORBA::string_dup(text.c_str());
- throw SALOME::SALOME_Exception(es);
- };
- // Close the target file
- ::close(fd);
-
- Engines::file infos;
- infos.file_name = CORBA::string_dup(file_name.c_str());
- infos.path = CORBA::string_dup(path.c_str());
- infos.type = CORBA::string_dup(type.c_str());
- infos.source_file_name = CORBA::string_dup(source_file_name.c_str());
- infos.status = CORBA::string_dup(status.c_str());
-
- _fileManaged[file_name] = infos;
-
- // Update Salome_file state
- _state.number_of_files++;
- _state.files_ok = true;
+ if ( (fd = ::open(file_name.c_str(),O_RDWR|O_CREAT,00666)) <0) {
+ SALOME::ExceptionStruct es;
+ es.type = SALOME::INTERNAL_ERROR;
+ std::string text = "open failed";
+ es.text = CORBA::string_dup(text.c_str());
+ throw SALOME::SALOME_Exception(es);
+ }
+ hdf_dataset->ReadFromDisk(buffer);
+ if ( write(fd,buffer,(unsigned int)size) <0) {
+ SALOME::ExceptionStruct es;
+ es.type = SALOME::INTERNAL_ERROR;
+ std::string text = "write failed";
+ es.text = CORBA::string_dup(text.c_str());
+ throw SALOME::SALOME_Exception(es);
+ }
+ // Close the target file
+ ::close(fd);
+
+ Engines::file infos;
+ infos.file_name = CORBA::string_dup(file_name.c_str());
+ infos.path = CORBA::string_dup(path.c_str());
+ infos.type = CORBA::string_dup(type.c_str());
+ infos.source_file_name = CORBA::string_dup(source_file_name.c_str());
+ infos.status = CORBA::string_dup(status.c_str());
+
+ _fileManaged[file_name] = infos;
+
+ // Update Salome_file state
+ _state.number_of_files++;
+ _state.files_ok = true;