Sharpen.FilePath.CanWrite C# (CSharp) Method

CanWrite() public method

public CanWrite ( ) : bool
return bool
		public bool CanWrite ()
		{
			return FileHelper.Instance.CanWrite (this);
		}

Usage Example

示例#1
0
 public virtual void Test002_WriteEmptyTree()
 {
     // One of our test packs contains the empty tree object. If the pack is
     // open when we create it we won't write the object file out as a loose
     // object (as it already exists in the pack).
     //
     Repository newdb = CreateBareRepository();
     ObjectInserter oi = newdb.NewObjectInserter();
     ObjectId treeId = oi.Insert(new TreeFormatter());
     oi.Release();
     NUnit.Framework.Assert.AreEqual("4b825dc642cb6eb9a060e54bf8d69288fbee4904", treeId
         .Name);
     FilePath o = new FilePath(new FilePath(new FilePath(newdb.Directory, "objects"),
         "4b"), "825dc642cb6eb9a060e54bf8d69288fbee4904");
     NUnit.Framework.Assert.IsTrue(o.IsFile(), "Exists " + o);
     NUnit.Framework.Assert.IsTrue(!o.CanWrite(), "Read-only " + o);
 }