Ignore:
Timestamp:
07/01/09 14:47:14 (15 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJob.cc

    r9345 r9471  
    401401    const Bool_t exists = !gSystem->AccessPathName(fname, kFileExists);
    402402    if (!exists)
     403    {
     404        const TString dirname = gSystem->DirName(fname);
     405
     406        Long_t flags;
     407        const Bool_t exists2 = !gSystem->GetPathInfo(dirname, 0, (Long_t*)0, &flags, 0);
     408        if (!exists2)
     409        {
     410            *fLog << err << "ERROR - Directory " << dirname << " doesn't exist." << endl;
     411            return kFALSE;
     412        }
     413
     414        if (flags&2==0)
     415        {
     416            *fLog << err << "ERROR - " << dirname << " is not a directory." << endl;
     417            return kFALSE;
     418        }
     419
     420        const Bool_t write = !gSystem->AccessPathName(dirname, kWritePermission);
     421        if (!write)
     422        {
     423            *fLog << err << "ERROR - No permission to write to directory " << dirname << endl;
     424            return kFALSE;
     425        }
     426
    403427        return kTRUE;
     428    }
     429
     430    Long_t flags;
     431    gSystem->GetPathInfo(fname, 0, (Long_t*)0, &flags, 0);
     432    if (flags&4)
     433    {
     434        *fLog << err << "ERROR - " << fname << " is not a regular file." << endl;
     435        return kFALSE;
     436    }
    404437
    405438    const Bool_t write = !gSystem->AccessPathName(fname, kWritePermission);
Note: See TracChangeset for help on using the changeset viewer.