Changeset 3061 for trunk


Ignore:
Timestamp:
2002-03-14T06:30:43+13:00 (22 years ago)
Author:
cs025
Message:

Added check to file handling - the server could fail to run correctly and
not report it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/corbaServer.mpp

    r2261 r3061  
    463463  // write id to "naming service"
    464464  ofstream out ("/tmp/localcorba.objid");
    465   out << ref << endl;
    466   out.close ();
    467 
     465    if (out.is_open()) {
     466        out << ref << endl;
     467        if (out.fail() || out.bad()) {
     468            cout << "Failed " << endl;
     469        }
     470        out.close ();
     471    }
     472    else {
     473        cout << "Unable to write string to file /tmp/localcorba.objid" << endl;
     474        cout << "Please check the file permissions/ownership" << endl;
     475        return 0;
     476    }
    468477  cout << "Corba string is " << ref << endl;
    469478
Note: See TracChangeset for help on using the changeset viewer.