示例#1
0
 public override bool Rename(string fromPath, string toPath, StreamRenameOptions options, StreamContext context)
 {
     try
     {
         File.Move(fromPath, toPath);
         return(true);
     }
     catch (UnauthorizedAccessException)
     {
         PhpException.Throw(PhpError.Warning, ErrResources.stream_file_access_denied, FileSystemUtils.StripPassword(fromPath));
     }
     catch (IOException)
     {
         PhpException.Throw(PhpError.Warning, ErrResources.stream_rename_file_exists, FileSystemUtils.StripPassword(fromPath), FileSystemUtils.StripPassword(toPath));
     }
     catch (Exception e)
     {
         PhpException.Throw(PhpError.Warning, ErrResources.stream_error, FileSystemUtils.StripPassword(fromPath), e.Message);
     }
     return(false);
 }
示例#2
0
 public virtual bool Rename(string fromPath, string toPath, StreamRenameOptions options, StreamContext context)
 {
     // int (*rename)(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC);
     PhpException.Throw(PhpError.Warning, ErrResources.wrapper_op_unsupported, "Rename");
     return(false);
 }
示例#3
0
 public override bool Rename(string fromPath, string toPath, StreamRenameOptions options, StreamContext context)
 {
     try
     {
         File.Move(fromPath, toPath);
         return true;
     }
     catch (UnauthorizedAccessException)
     {
         PhpException.Throw(PhpError.Warning, ErrResources.stream_file_access_denied, FileSystemUtils.StripPassword(fromPath));
     }
     catch (IOException)
     {
         PhpException.Throw(PhpError.Warning, ErrResources.stream_rename_file_exists, FileSystemUtils.StripPassword(fromPath), FileSystemUtils.StripPassword(toPath));
     }
     catch (System.Exception e)
     {
         PhpException.Throw(PhpError.Warning, ErrResources.stream_error, FileSystemUtils.StripPassword(fromPath), e.Message);
     }
     return false;
 }
示例#4
0
 /// <include file='Doc/Wrappers.xml' path='docs/method[@name="Rename"]/*'/>
 public override bool Rename(string fromPath, string toPath, StreamRenameOptions options, StreamContext context)
 {
     return(proxy.Rename(fromPath, toPath, (int)options, null));
 }
示例#5
0
 public virtual bool Rename(string fromPath, string toPath, StreamRenameOptions options, StreamContext context)
 {
     // int (*rename)(php_stream_wrapper *wrapper, char *url_from, char *url_to, int options, php_stream_context *context TSRMLS_DC);
     PhpException.Throw(PhpError.Warning, ErrResources.wrapper_op_unsupported, "Rename");
     return false;
 }