Mkdirs() public method

Creates a directory with the path specified by this SmbFile and any parent directories that do not exist.
Creates a directory with the path specified by this SmbFile and any parent directories that do not exist. This method will fail when used with smb://, smb://workgroup/, smb://server/, or smb://server/share/ URLs because workgroups, servers, and shares cannot be dynamically created (although in the future it may be possible to create shares).
SmbException
public Mkdirs ( ) : void
return void
Example #1
0
 /// <summary>
 /// Creates a directory with the path specified by this <tt>SmbFile</tt>
 /// and any parent directories that do not exist.
 /// </summary>
 /// <remarks>
 /// Creates a directory with the path specified by this <tt>SmbFile</tt>
 /// and any parent directories that do not exist. This method will fail
 /// when used with <code>smb://</code>, <code>smb://workgroup/</code>,
 /// <code>smb://server/</code>, or <code>smb://server/share/</code> URLs
 /// because workgroups, servers, and shares cannot be dynamically created
 /// (although in the future it may be possible to create shares).
 /// </remarks>
 /// <exception cref="SmbException">SmbException</exception>
 /// <exception cref="SharpCifs.Smb.SmbException"></exception>
 public virtual void Mkdirs()
 {
     SmbFile parent;
     try
     {
         parent = new SmbFile(GetParent(), Auth);
     }
     catch (IOException)
     {
         return;
     }
     if (parent.Exists() == false)
     {
         parent.Mkdirs();
     }
     Mkdir();
 }