Salome HOME
add options-help get from launcher
[modules/kernel.git] / src / Container / SALOME_FileTransfer_i.cxx
index d379bb2f224dc2f684dd73458d5e039efb6002ad..f83d9de95c00105dd6badcba08444fd09d1cd1c2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -41,7 +41,6 @@
 
 fileTransfer_i::fileTransfer_i()
 {
-  MESSAGE("fileTransfer_i::fileTransfer_i");
   _fileKey=1;
 }
 
@@ -53,7 +52,6 @@ fileTransfer_i::fileTransfer_i()
 
 fileTransfer_i::~fileTransfer_i()
 {
-  MESSAGE("fileTransfer_i::~fileTransfer_i");
 }
 
 
@@ -62,14 +60,13 @@ fileTransfer_i::~fileTransfer_i()
  *
  *  CORBA method: try to open the file. If the file is readable, return
  *  a positive integer else return 0;
- *  \param  fileName path to the file to be transfered
+ *  \param  fileName path to the file to be transferred
  *  \return fileId = positive integer > 0 if open OK.
  */
 //=============================================================================
 
 CORBA::Long fileTransfer_i::open(const char* fileName)
 {
-  MESSAGE(" fileTransfer_i::open " << fileName);
   int aKey = _fileKey++;
   _ctr=0;
   FILE* fp;
@@ -92,7 +89,6 @@ CORBA::Long fileTransfer_i::open(const char* fileName)
 
 void fileTransfer_i::close(CORBA::Long fileId)
 {
-  MESSAGE("fileTransfer_i::close");
   FILE* fp;
   if (! (fp = _fileAccess[fileId]) )
     {
@@ -119,7 +115,6 @@ void fileTransfer_i::close(CORBA::Long fileId)
 
 Engines::fileBlock* fileTransfer_i::getBlock(CORBA::Long fileId)
 {
-  MESSAGE("fileTransfer_i::getBlock");
   Engines::fileBlock* aBlock = new Engines::fileBlock;
 
   FILE* fp;
@@ -134,9 +129,9 @@ Engines::fileBlock* fileTransfer_i::getBlock(CORBA::Long fileId)
   
   CORBA::Octet *buf;
   buf = Engines::fileBlock::allocbuf(FILEBLOCK_SIZE);
-  int nbRed = fread(buf, sizeof(CORBA::Octet), FILEBLOCK_SIZE, fp);
-  SCRUTE(nbRed);
-  aBlock->replace(nbRed, nbRed, buf, 1); // 1 means give ownership
+  size_t nbRed = fread(buf, sizeof(CORBA::Octet), FILEBLOCK_SIZE, fp);
+  //SCRUTE(nbRed);
+  aBlock->replace((CORBA::ULong)nbRed, (CORBA::ULong)nbRed, buf, 1); // 1 means give ownership
   return aBlock;
 }
 
@@ -144,12 +139,11 @@ Engines::fileBlock* fileTransfer_i::getBlock(CORBA::Long fileId)
  *
  *  CORBA method: try to open the file. If the file is writable, 
  *  return a positive integer else return 0;
- *  \param  fileName path to the file to be transfered
+ *  \param  fileName path to the file to be transferred
  *  \return fileId = positive integer > 0 if open OK.
  */
 CORBA::Long fileTransfer_i::openW(const char* fileName)
 {
-  MESSAGE(" fileTransfer_i::openW " << fileName);
   int aKey = _fileKey++;
   _ctr=0;
   FILE* fp;
@@ -171,7 +165,6 @@ CORBA::Long fileTransfer_i::openW(const char* fileName)
  */
 void fileTransfer_i::putBlock(CORBA::Long fileId, const Engines::fileBlock& block)
 {
-  MESSAGE("fileTransfer_i::putBlock");
   FILE* fp;
   if (! (fp = _fileAccess[fileId]) )
     {