diff --git a/src/XrdCl/XrdClCopyProcess.cc b/src/XrdCl/XrdClCopyProcess.cc index a7b20fea495..b2d2b5d6b27 100644 --- a/src/XrdCl/XrdClCopyProcess.cc +++ b/src/XrdCl/XrdClCopyProcess.cc @@ -291,47 +291,50 @@ namespace XrdCl if( !target.IsValid() ) return XRootDStatus( stError, errInvalidArgs, 0, "invalid target" ); - // handle directories - FileSystem fs( target ); - StatInfo *infoptr = 0; - XRootDStatus st = fs.Stat( target.GetPath(), infoptr ); - - if( !st.IsOK() ) - { - if( st.code != errNotFound && st.errNo != kXR_NotFound ) - return st; - } - else + if( target.GetProtocol() != "stdio" ) { - std::unique_ptr info( infoptr ); - if( info->TestFlags( StatInfo::IsDir) ) - { - std::string path = target.GetPath() + '/'; - std::string fn; + // handle directories + FileSystem fs( target ); + StatInfo *infoptr = 0; + XRootDStatus st = fs.Stat( target.GetPath(), infoptr ); - bool isZip = false; - props.Get( "zipArchive", isZip ); - if( isZip ) - { - props.Get( "zipSource", fn ); - } - else if( source.IsMetalink() ) - { - RedirectorRegistry ®istry = XrdCl::RedirectorRegistry::Instance(); - VirtualRedirector *redirector = registry.Get( source ); - fn = redirector->GetTargetName(); - } - else + if( !st.IsOK() ) + { + if( st.code != errNotFound && st.errNo != kXR_NotFound ) + return st; + } + else + { + std::unique_ptr info( infoptr ); + if( info->TestFlags( StatInfo::IsDir) ) { - fn = source.GetPath(); + std::string path = target.GetPath() + '/'; + std::string fn; + + bool isZip = false; + props.Get( "zipArchive", isZip ); + if( isZip ) + { + props.Get( "zipSource", fn ); + } + else if( source.IsMetalink() ) + { + RedirectorRegistry ®istry = XrdCl::RedirectorRegistry::Instance(); + VirtualRedirector *redirector = registry.Get( source ); + fn = redirector->GetTargetName(); + } + else + { + fn = source.GetPath(); + } + + size_t pos = fn.rfind( '/' ); + if( pos != std::string::npos ) + fn = fn.substr( pos + 1 ); + path += fn; + target.SetPath( path ); + props.Set( "target", target.GetURL() ); } - - size_t pos = fn.rfind( '/' ); - if( pos != std::string::npos ) - fn = fn.substr( pos + 1 ); - path += fn; - target.SetPath( path ); - props.Set( "target", target.GetURL() ); } }