if (mode == "all") {
- // Changing path, is now current directory
- path = getcwd(NULL, _path_max);
+ // Changing path, is now current directory
+ path = getcwd(NULL, _path_max);
- std::string group_name("GROUP");
- group_name += file_name;
- hdf_group = new HDFgroup(group_name.c_str(),hdf_file);
- hdf_group->OpenOnDisk();
- hdf_dataset = new HDFdataset("FILE DATASET",hdf_group);
- hdf_dataset->OpenOnDisk();
- size = hdf_dataset->GetSize();
- buffer = new char[size];
+ std::string group_name("GROUP");
+ group_name += file_name;
+ hdf_group = new HDFgroup(group_name.c_str(),hdf_file);
+ hdf_group->OpenOnDisk();
+ hdf_dataset = new HDFdataset("FILE DATASET",hdf_group);
+ hdf_dataset->OpenOnDisk();
+ size = hdf_dataset->GetSize();
+ buffer = new char[size];
- 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,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;
}
else {
- 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());
- // Infos for parallel extensions...
- infos.node = 0;
- infos.container = Engines::Container::_duplicate(_container);
-
- _fileManaged[file_name] = infos;
-
- // Update Salome_file state
- _state.number_of_files++;
- if (status != "ok")
- _state.files_ok = false;
+ 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());
+ // Infos for parallel extensions...
+ infos.node = 0;
+ infos.container = Engines::Container::_duplicate(_container);
+
+ _fileManaged[file_name] = infos;
+
+ // Update Salome_file state
+ _state.number_of_files++;
+ if (status != "ok")
+ _state.files_ok = false;
}
}
}
_t_fileDistributedSource::iterator it = _fileDistributedSource.find(file_name);
if (it == _fileDistributedSource.end())
{
- _fileDistributedSource[file_name] = Engines::Salome_file::_duplicate(source_Salome_file);
+ _fileDistributedSource[file_name] = Engines::Salome_file::_duplicate(source_Salome_file);
}
}
}
//=============================================================================
void
Salome_file_i::connectDistributedFile(const char * file_name,
- Engines::Salome_file_ptr source_Salome_file)
+ Engines::Salome_file_ptr source_Salome_file)
{
// Test if this file is added
_t_fileManaged::iterator it = _fileManaged.find(file_name);
//=============================================================================
void
Salome_file_i::setDistributedSourceFile(const char* file_name,
- const char * source_file_name)
+ const char * source_file_name)
{
std::string fname(file_name);
if (std::string(file_infos.type.in()) == "local")
{
if (std::string(file_infos.status.in()) == "not_ok")
- result = checkLocalFile(file_infos.file_name.in());
+ result = checkLocalFile(file_infos.file_name.in());
}
else
{
if (std::string(file_infos.status.in()) == "not_ok")
- result = getDistributedFile(file_infos.file_name.in());
+ result = getDistributedFile(file_infos.file_name.in());
}
// if the result is false
// we add this file to files_not_ok