本文整理汇总了C#中FileNode.setMount方法的典型用法代码示例。如果您正苦于以下问题:C# FileNode.setMount方法的具体用法?C# FileNode.setMount怎么用?C# FileNode.setMount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileNode
的用法示例。
在下文中一共展示了FileNode.setMount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: mount
public fileSystem mount(int mode, string fsTypeName, string mountPoint, string[] args)
{
string workPath = "/";
FileNode aNode;
string[] pathArray = mountPoint.Split('/');
int counter = 0;
fileSystem toMount = null;
/*
if (fsTypeName == "localfs")
toMount = new LocalFS();
if (fsTypeName == "timefs")
toMount = new ClockFS();
if (fsTypeName == "winfs")
toMount = new WinFS();
if (fsTypeName == "sysfs")
toMount = new SysFS(args[0]);
if (fsTypeName == "homefs")
toMount = new HomeFS();
if (fsTypeName == "procfs")
toMount = new ProcFS();
if (fsTypeName == "xmppfs")
toMount = new XMPPFS();
*/
while (counter <= pathArray.Length - 2)
{
if (workPath == "/")
workPath = workPath + pathArray[counter];
else
workPath = workPath + '/' + pathArray[counter];
counter++;
}
aNode = this.walk(workPath);
//parse list of available filesystems for the one we've been asked to mount
//while (counter < vfsList.length && vfsList[counter].Name != fs_type)
//{
// counter++;
//}
if (aNode.getType() == 1)//&& vfsList[counter].Name == fs_type)
{
var count = 0;
if (aNode.getDirList().Count > 0)
{
while (count < aNode.getData().Length - 1 && aNode.getDirList()[count].getName() != pathArray[pathArray.Length - 1])
{
count++;
}
aNode.getDirList();
}
FileNode newFile = new FileNode(pathArray[pathArray.Length - 1], fileTypes.Mount);
newFile.addParent(aNode);
aNode.addChild(newFile);
if (aNode.countChildren() > 0)
{
newFile.setPrev(aNode.getDirList().ElementAt(aNode.countChildren() - 1));
}
if (aNode.countChildren() >= 2)
{
aNode.getDirList()[aNode.countChildren() - 2].setNext(newFile);
}
this.touched(aNode);
newFile.setMount(toMount);
return toMount.onmount(mountPoint);// serverAddress, fs_type, mountPoint, user, pass, argv));
}
else
return null;
}