Deck 9: File and Folder Administration
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/49
العب
ملء الشاشة (f)
Deck 9: File and Folder Administration
1
By default, a computer receives standard input ( STDIN ) from the keyboard
True
2
Ruby allows you to delete both files and folders using the File and Dir classes's delete methods.
True
3
When executed on Microsoft Windows, Ruby program file and path data must be specified using the backslash character.
True
4
By default, a computer sends standard output ( STDOUT ) to the computer's hard drive.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
5
Ruby lists the contents of a folder using the Dir class's files method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
6
Ruby allows you to create new folders using the Dir class's creatdir method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
7
Using the File class's folder? method, you can determine if a resource is a folder or something else (socket, pipe, etc.).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
8
If you attempt to delete a file or folder that does not exist, or if you try to delete a folder that is not empty, Ruby will ignore the error and substitute an empty file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
9
Ruby allows you to rename a file using the File class's rename method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
10
To determine if a file or folder exists, use the File class's exist? method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
11
The File class gives you access to various file administration methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
12
The File class also contains a method named file? , which can be used to determine whether a resource is a file or something else.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
13
The Dir class's entries method returns the contents of the folder as an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
14
One limitation within Ruby programming is the inability to redirect STDIN and STDOUT .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
15
The Folder class gives you access to various folder administration methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
16
The operating system, and not Ruby, provides both the > and the redirection operators.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
17
Given a script named DispMsg.rb, if an empty file were used as input to: ruby DispMsg.rb a value of nil would be assigned to the message variable in the statement: message = STDIN.gets
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
18
The movement of data from one place to another is referred to as data input and data output.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
19
The Dir class's size method returns a count of the specified file's size in bytes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
20
To determine if a file has any data in it, you can use the File class's size method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
21
To determine if a file or folder exists, use the File class's ____ method.
A) file?
B) value
C) exist?
D) found?
A) file?
B) value
C) exist?
D) found?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
22
Which of the following File class methods can be used to determine if a file or folder exists?
A) location?
B) found?
C) exist?
D) file?
A) location?
B) found?
C) exist?
D) file?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which of the mode options opens a file for writing only, overwriting any existing text by placing the pointer at the beginning of the file.
A) w
B) w+
C) a
D) a+
A) w
B) w+
C) a
D) a+
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
24
If an empty file were used as input to the operator, a ____ value is returned.
A) empty string
B) nil
C) zero
D) null
A) empty string
B) nil
C) zero
D) null
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
25
Which of the following Dir class methods can be used to create a new folder?
A) mkdir
B) createdir
C) mk
D) create
A) mkdir
B) createdir
C) mk
D) create
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
26
Which of the following characters can be used as a shortcut for representing resources stored within the current working directory?
A) _
B) -
C) .
D) @
A) _
B) -
C) .
D) @
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
27
RUBY_PLATFORM contains a string that identifies the type of operating system on which a script is executing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
28
Which of the following File class methods can be used to determine if a file has any data in it?
A) length
B) size?
C) name?
D) size
A) length
B) size?
C) name?
D) size
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
29
Which of the mode options opens a file for reading only?
A) r
B) r+
C) a
D) a+
A) r
B) r+
C) a
D) a+
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
30
Which of the following is the Ruby redirection output operator?
A) =
B) =>
C) >
D) ^
A) =
B) =>
C) >
D) ^
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
31
Which of the mode options opens a file for both reading and writing, overwriting any existing text. If the specified file does not exist, it is created.
A) w
B) w+
C) a
D) a+
A) w
B) w+
C) a
D) a+
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
32
If you develop a script that will run on different operating systems, you will need a way to determine which type of operating system your script is currently executing on. One way to do this is by taking advantage of Ruby's RUBY_PLATFORM special variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
33
RUBY_PLATFORM contains a string that identifies the manufacturer of the operating system on which a script is executing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
34
Which of the following File class methods can be used to determine if a resource is a folder or something else?
A) directory?
B) file?
C) found?
D) type?
A) directory?
B) file?
C) found?
D) type?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which of the mode options opens a file for both reading and writing?
A) r
B) r+
C) a
D) a+
A) r
B) r+
C) a
D) a+
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
36
When executed on UNIX or Linux, Ruby program file and path data must be specified using the backslash character.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
37
A special variable is a specially named variable that once you have defined it, is automatically updated by Ruby during program execution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
38
Which of the following File and Dir methods can be used to delete both files and folders?
A) remove
B) delete
C) kill
D) del
A) remove
B) delete
C) kill
D) del
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
39
Which of the following File class methods can be used to determine if a resource is a file or something else?
A) directory?
B) file?
C) found?
D) type?
A) directory?
B) file?
C) found?
D) type?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
40
Which of the following Dir class methods can be used to return a list of the contents of a folder in the form of an array.
A) list?
B) entries
C) collection
D) content
A) list?
B) entries
C) collection
D) content
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
41
Which of the following File class methods can be used to change a file's name?
A) change
B) update
C) modify
D) rename
A) change
B) update
C) modify
D) rename
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
42
Which of the mode options opens a file in append mode, allowing for both reading and writing while preserving any preexisting text.
A) w
B) w+
C) a
D) a+
A) w
B) w+
C) a
D) a+
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
43
A reference can be set up for a file using which of the following File methods?
A) new
B) existing
C) open
D) file
A) new
B) existing
C) open
D) file
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
44
What type of variable is the RUBY_PLATFORM special variable?
A) integer
B) float
C) bignum
D) string
A) integer
B) float
C) bignum
D) string
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
45
Which of the following best describes a special variable?
A) It is a variable specified by the programmers and maintained by Ruby.
B) It is a variable automatically created by Ruby but for which the programmer must assign an initial value.
C) It is a variable that is automatically created and maintained by Ruby.
D) It is a variable that is automatically created by Ruby for its use only.
A) It is a variable specified by the programmers and maintained by Ruby.
B) It is a variable automatically created by Ruby but for which the programmer must assign an initial value.
C) It is a variable that is automatically created and maintained by Ruby.
D) It is a variable that is automatically created by Ruby for its use only.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
46
Which of the following methods can be used to open a file for reading?
A) new
B) access
C) open
D) process
A) new
B) access
C) open
D) process
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
47
Which of the following is a special variable containing a string that identifies the type of operating system on which a script is executed?
A) RUBY_SYSTEM
B) RUBY_PLATFORM
C) RUBY_OSTYPE
D) RUBY_TYPE
A) RUBY_SYSTEM
B) RUBY_PLATFORM
C) RUBY_OSTYPE
D) RUBY_TYPE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
48
Which of the mode options opens a file in append mode, preserving any preexisting text while allowing new text to be added to the end of the file.
A) w
B) w+
C) a
D) a+
A) w
B) w+
C) a
D) a+
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck
49
Which of the following actions occur if you attempt to delete a file or folder that does not exist?
A) Ruby ignores the error and allows the program to continue
B) Ruby deletes any files found in the current working directory
C) An error is generated and program execution terminates
D) None of the above
A) Ruby ignores the error and allows the program to continue
B) Ruby deletes any files found in the current working directory
C) An error is generated and program execution terminates
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 49 في هذه المجموعة.
فتح الحزمة
k this deck