Ejemplo n.º 1
0
        /*
         * A function which gets a path to use for changing permissions from the user
         * and sets it as the passed in wrapper's path.
         */
        public void setDir(FluentWrapper wrapper)
        {
            Console.WriteLine("\nEnter Path from Root of File to Change Permissions For : ");
            String dir = Console.ReadLine();

            wrapper.setPath(dir);
        }
Ejemplo n.º 2
0
        /**
         * This function is used to get permissions from the user to set.
         * The console prints information to the user on the allowed format
         * get the user's input, verifies it for correctness, and then
         * sets it as the passed in wrapper's permissions.
         */
        public void setPerms(FluentWrapper wrapper)
        {
            Console.WriteLine("\nPlease enter the 3 digit numeric value of the permissions to set.");
            Console.WriteLine("Accept values for each digit are 0-7.\nThe leftmost digit is for the user.\nThe center digit is for the group.\nThe right most digit is for Others.");
            Console.WriteLine("Values are: 0 - No Permissions, 1 - Execute only, 2 - Write Only, 3 - Write and Execute\n4 - Read Only, 5 - Read and Execute, 6 - Read and Write, 7 - Read, Write, Execute");
            Console.WriteLine("Enter Permissions to Set : ");
            bool   ready = false;
            String value = "";

            while (ready != true)
            {
                //Check if length requirement is met
                ready = true;
                value = Console.ReadLine();
                ready = checkInput(value);

                if (ready == false)
                {
                    Console.WriteLine("\nPlease three digits with values 0-7 for each digit");
                }
            }

            wrapper.setPermission(int.Parse(value));
        }