Пример #1
0
        /// <summary>
        /// Creates a new node in the (virtual) filesystem.
        /// </summary>
        /// <param name="path">The path to create.</param>
        /// <param name="type">The type of the node to create.</param>
        /// <param name="settings">Settings used to initialize the node.</param>
        /// <param name="access">Requests the specified access modes on the created object.</param>
        /// <param name="share">Requests the specified sharing settings on the object.</param>
        /// <returns>The created filesystem object.</returns>
        /// <remarks>
        /// This function creates new nodes in the virtual filesystem. In contrast to *nix this call
        /// creates all node types, e.g. files, directories, devices and more. Specific types may
        /// require additional settings, which are specified in a settings object passed as the third
        /// parameter.
        /// </remarks>
        public static object Create(string path, VfsNodeType type, object settings, FileAccess access, FileShare share)
        {
            // Retrieve the parent directory
            DirectoryEntry parent = PathResolver.Resolve(rootNode, ref path, PathResolutionFlags.RetrieveParent);

            // Check if the caller has write access in the directory
            AccessCheck.Perform(parent, AccessMode.Write, AccessCheckFlags.None);

            // Yes, we do have write access. Create the new vfs node
            IVfsNode node = parent.Node.Create(path, type, settings);
            // FIXME: Assert(null != node);
            DirectoryEntry entry = DirectoryEntry.Allocate(parent, path, node);

            // FIXME: Fix the permissions for this call. *nix does this using its bitmasks, Win32 through its huge CreateFile API.
            return(node.Open(access, share));
        }
Пример #2
0
 /// <summary>
 /// Creates a new filesystem entry of the given name and type.
 /// </summary>
 /// <param name="name">The name of the filesystem entry to create.</param>
 /// <param name="type">The type of the filesystem entry. See remarks.</param>
 /// <param name="settings">Potential settings for the file systeme entry.</param>
 /// <returns>
 /// The created file system node for the requested object.
 /// </returns>
 /// <exception cref="System.NotSupportedException">The specified nodetype is not supported in the filesystem owning the node. See remarks about this.</exception>
 /// <remarks>
 /// In theory every filesystem should support any VfsNodeType. Standard objects, such as directories and files are obvious. For other objects however, the
 /// file system is encouraged to store the passed settings in a specially marked file and treat these files as the appropriate node type. Instances of these
 /// objects can be retrieved using VfsObjectFactory.Create(settings).
 /// <para/>
 /// Access rights do not need to be checked by the node implementation. They have been already been checked by the VirtualFileSystem itself.
 /// </remarks>
 public override IVfsNode Create(string name, VfsNodeType type, object settings)
 {
     return(null);
 }
Пример #3
0
 /// <summary>
 /// Creates a new file system entry of the given name and type.
 /// </summary>
 /// <param name="name">The name of the file system entry to create.</param>
 /// <param name="type">The type of the file system entry. See remarks.</param>
 /// <param name="settings">Potential settings for the file systeme entry.</param>
 /// <returns>
 /// The created file system node for the requested object.
 /// </returns>
 /// <exception cref="System.NotSupportedException">The specified node type is not supported in the file system owning the node. See remarks about this.</exception>
 /// <remarks>
 /// In theory every file system should support any VfsNodeType. Standard objects, such as directories and files are obvious. For other objects however, the
 /// file system is encouraged to store the passed settings in a specially marked file and treat these files as the appropriate node type. Instances of these
 /// objects can be retrieved using VfsObjectFactory.Create(settings).
 /// <para/>
 /// Access rights do not need to be checked by the node implementation. They have been already been checked by the VirtualFileSystem itself.
 /// </remarks>
 public override IVfsNode Create(string name, VfsNodeType type, object settings)
 {
     // TODO
     throw new System.NotSupportedException("file write not supported");
 }
Пример #4
0
 /// <summary>
 /// Creates a new file system entry of the given name and type.
 /// </summary>
 /// <param name="name">The name of the file system entry to create.</param>
 /// <param name="type">The type of the file system entry. See remarks.</param>
 /// <param name="settings">Potential settings for the file system entry.</param>
 /// <returns>
 /// The created file system node for the requested object.
 /// </returns>
 /// <exception cref="System.NotSupportedException">The specified node type is not supported in the file system owning the node. See remarks about this.</exception>
 /// <remarks>
 /// In theory every file system should support any VfsNodeType. Standard objects, such as directories and files are obvious. For other objects however, the
 /// file system is encouraged to store the passed settings in a specially marked file and treat these files as the appropriate node type. Instances of these
 /// objects can be retrieved using VfsObjectFactory.Create(settings).
 /// <para/>
 /// Access rights do not need to be checked by the node implementation. They have been already been checked by the VirtualFileSystem itself.
 /// </remarks>
 public override IVfsNode Create(string name, VfsNodeType type, object settings)
 {
     return null;
 }
Пример #5
0
		public override IVfsNode Create (string name, VfsNodeType type, object settings)
		{
			// Pass this request to the link target node.
			// FIXME: throw new NotImplementedException();
			return null;
		}
Пример #6
0
 /// <summary>
 /// Creates a new file system entry of the given name and type.
 /// </summary>
 /// <param name="name">The name of the file system entry to create.</param>
 /// <param name="type">The type of the file system entry. See remarks.</param>
 /// <param name="settings">Potential settings for the file systeme entry.</param>
 /// <returns>
 /// The created file system node for the requested object.
 /// </returns>
 /// <exception cref="System.NotSupportedException">The specified nodetype is not supported in the file system owning the node. See remarks about this.</exception>
 /// <remarks>
 /// In theory every file system should support any VfsNodeType. Standard objects, such as directories and files are obvious. For other objects however, the
 /// file system is encouraged to store the passed settings in a specially marked file and treat these files as the appropriate node type. Instances of these
 /// objects can be retrieved using VfsObjectFactory.Create(settings).
 /// <para/>
 /// Access rights do not need to be checked by the node implementation. They have been already been checked by the VirtualFileSystem itself.
 /// </remarks>
 public abstract IVfsNode Create(string name, VfsNodeType type, object settings);
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeBase"/> class.
 /// </summary>
 /// <param name="fs">The fs.</param>
 /// <param name="type">The type.</param>
 protected NodeBase(IFileSystem fs, VfsNodeType type)
 {
     this.fs   = fs;
     this.type = type;
 }
Пример #8
0
 /// <summary>
 /// Creates the specified name.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="nodeType">Type of the node.</param>
 /// <param name="settings">The settings.</param>
 /// <returns></returns>
 public override IVfsNode Create(string name, VfsNodeType nodeType, object settings)
 {
     // FIXME: throw new NotImplementedException();
     return(null);
 }
Пример #9
0
 /// <summary>
 /// Creates the specified name.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="nodeType">Type of the node.</param>
 /// <param name="settings">The settings.</param>
 /// <returns></returns>
 public override IVfsNode Create(string name, VfsNodeType nodeType, object settings)
 {
     // FIXME: throw new NotImplementedException();
     return null;
 }
Пример #10
0
 /// <summary>
 /// Creates a new filesystem entry of the given name and type.
 /// </summary>
 /// <param name="name">The name of the filesystem entry to create.</param>
 /// <param name="type">The type of the filesystem entry. See remarks.</param>
 /// <param name="settings">Potential settings for the file systeme entry.</param>
 /// <returns>
 /// The created file system node for the requested object.
 /// </returns>
 /// <exception cref="System.NotSupportedException">The specified nodetype is not supported in the filesystem owning the node. See remarks about this.</exception>
 /// <remarks>
 /// In theory every filesystem should support any VfsNodeType. Standard objects, such as directories and files are obvious. For other objects however, the
 /// file system is encouraged to store the passed settings in a specially marked file and treat these files as the appropriate node type. Instances of these
 /// objects can be retrieved using VfsObjectFactory.Create(settings).
 /// <para/>
 /// Access rights do not need to be checked by the node implementation. They have been already been checked by the VirtualFileSystem itself.
 /// </remarks>
 public abstract IVfsNode Create(string name, VfsNodeType type, object settings);
Пример #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeBase"/> class.
 /// </summary>
 /// <param name="fs">The fs.</param>
 /// <param name="type">The type.</param>
 protected NodeBase(IFileSystem fs, VfsNodeType type)
 {
     this.fs = fs;
     this.type = type;
 }
Пример #12
0
        /// <summary>
        /// Creates a new node in the (virtual) filesystem.
        /// </summary>
        /// <param name="path">The path to create.</param>
        /// <param name="type">The type of the node to create.</param>
        /// <param name="settings">Settings used to initialize the node.</param>
        /// <param name="access">Requests the specified access modes on the created object.</param>
        /// <param name="share">Requests the specified sharing settings on the object.</param>
        /// <returns>The created filesystem object.</returns>
        /// <remarks>
        /// This function creates new nodes in the virtual filesystem. In contrast to *nix this call
        /// creates all node types, e.g. files, directories, devices and more. Specific types may
        /// require additional settings, which are specified in a settings object passed as the third
        /// parameter.
        /// </remarks>
        public static object Create(string path, VfsNodeType type, object settings, System.IO.FileAccess access, System.IO.FileShare share)
        {
            // Retrieve the parent directory
            DirectoryEntry parent = PathResolver.Resolve(rootNode, ref path, PathResolutionFlags.RetrieveParent);

            // Check if the caller has write access in the directory
            AccessCheck.Perform(parent, AccessMode.Write, AccessCheckFlags.None);

            // Yes, we do have write access. Create the new vfs node
            IVfsNode node = parent.Node.Create(path, type, settings);
            // FIXME: Assert(null != node);
            DirectoryEntry entry = DirectoryEntry.Allocate(parent, path, node);

            // FIXME: Fix the permissions for this call. *nix does this using its bitmasks, Win32 through its huge CreateFile API.
            return node.Open(access, share);
        }
Пример #13
0
 /// <summary>
 /// Creates a new filesystem entry of the given name and type.
 /// </summary>
 /// <param name="name">The name of the filesystem entry to create.</param>
 /// <param name="type">The type of the filesystem entry. See remarks.</param>
 /// <param name="settings">Potential settings for the file systeme entry.</param>
 /// <returns>
 /// The created file system node for the requested object.
 /// </returns>
 /// <exception cref="System.NotSupportedException">The specified nodetype is not supported in the filesystem owning the node. See remarks about this.</exception>
 /// <remarks>
 /// In theory every filesystem should support any VfsNodeType. Standard objects, such as directories and files are obvious. For other objects however, the
 /// file system is encouraged to store the passed settings in a specially marked file and treat these files as the appropriate node type. Instances of these
 /// objects can be retrieved using VfsObjectFactory.Create(settings).
 /// <para/>
 /// Access rights do not need to be checked by the node implementation. They have been already been checked by the VirtualFileSystem itself.
 /// </remarks>
 public override IVfsNode Create(string name, VfsNodeType type, object settings)
 {
     // TODO
     throw new System.NotSupportedException("file write not supported");
 }
Пример #14
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <param name="type"></param>
 /// <param name="settings"></param>
 /// <returns></returns>
 public override IVfsNode Create(string name, VfsNodeType type, object settings)
 {
     // Pass this request to the link target node.
     // FIXME: throw new NotImplementedException();
     return(null);
 }