예제 #1
0
파일: FileSystem.cs 프로젝트: sttt/madb
        /// <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();

            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);
        }
예제 #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);
        }
예제 #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 );
        }
예제 #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 );
            }
        }