Ejemplo n.º 1
0
        /// <summary>
        /// Mounts the specified device.
        /// </summary>
        /// <param name="mountPoint">The mp.</param>
        /// <param name="options">The options.</param>
        public void Mount(MountPoint mountPoint, string options)
        {
            mountPoint.ThrowIfNull("mountPoint");
            Device.ThrowIfNull("Device");

            CommandErrorReceiver cer = new CommandErrorReceiver( );

            if (Device.BusyBox.Available)
            {
                Device.ExecuteShellCommand("busybox mount {0} {4} -t {1} {2} {3}", cer, mountPoint.IsReadOnly ? "-r" : "-w",
                                           mountPoint.FileSystem, mountPoint.Block, mountPoint.Name,
                                           !string.IsNullOrEmpty(options) ? string.Format("-o {0}", options) : string.Empty);
            }
            else
            {
                Device.ExecuteShellCommand("mount {0} {4} -t {1} {2} {3}", cer, mountPoint.IsReadOnly ? "-r" : "-w",
                                           mountPoint.FileSystem, mountPoint.Block, mountPoint.Name,
                                           !string.IsNullOrEmpty(options) ? string.Format("-o {0}", options) : string.Empty);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Unmounts the specified mount point.
        /// </summary>
        /// <param name="mountPoint">The mountPoint.</param>
        /// <param name="options">The options.</param>
        public void Unmount(MountPoint mountPoint, string options)
        {
            mountPoint.ThrowIfNull("mountPoint");

            Unmount(mountPoint.Name, options);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Unmounts the specified mount point.
        /// </summary>
        /// <param name="mountPoint">The mountPoint.</param>
        /// <param name="options">The options.</param>
        public void Unmount( MountPoint mountPoint, string options )
        {
            mountPoint.ThrowIfNull ( "mountPoint" );

            Unmount ( mountPoint.Name, options );
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Mounts the specified device.
        /// </summary>
        /// <param name="mountPoint">The mp.</param>
        /// <param name="options">The options.</param>
        public void Mount( MountPoint mountPoint, string options )
        {
            mountPoint.ThrowIfNull ( "mountPoint" );
            Device.ThrowIfNull ( "Device" );

            CommandErrorReceiver cer = new CommandErrorReceiver ( );
            if ( Device.BusyBox.Available ) {
                Device.ExecuteShellCommand ( "busybox mount {0} {4} -t {1} {2} {3}", cer, mountPoint.IsReadOnly ? "-r" : "-w",
                    mountPoint.FileSystem, mountPoint.Block, mountPoint.Name,
                    !string.IsNullOrEmpty ( options ) ? string.Format ( "-o {0}", options ) : string.Empty );
            } else {
                Device.ExecuteShellCommand ( "mount {0} {4} -t {1} {2} {3}", cer, mountPoint.IsReadOnly ? "-r" : "-w",
                    mountPoint.FileSystem, mountPoint.Block, mountPoint.Name,
                    !string.IsNullOrEmpty ( options ) ? string.Format ( "-o {0}", options ) : string.Empty );
            }
        }