Deck 5: Working With Files and Directories
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/84
العب
ملء الشاشة (f)
Deck 5: Working With Files and Directories
1
You use the createDir() function to create a new directory.
False
2
You can use the opendir() function to return the file and directory names from the open directory.
False
3
An additional form attribute, enctype, with a value of "multipart/form-data" must be used to upload files.
True
4
The directory pointer is a way of keeping track of where you are in a directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
5
A handle is a special type of variable that PHP uses to represent a resource, such as a file or directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
6
The file_exists() function determines whether a file or directory exists.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
7
You can specify the maximum size of an uploaded file using MAX_FILE SIZE as a hidden input field below the file input field.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
8
PHP recognizes two types of files: binary and text.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
9
The chdir() function changes to the name of the specified directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
10
The fileperms() function allows the user to read the permissions associated with a particular file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
11
The three levels of permissions for files and directories are Read, Write, and Delete.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
12
The scandir() function returns an indexed array containing the names of files and directories in a specified directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
13
Both the echo() and print() statements send data to an input stream.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
14
PHP provides the chper() function for changing the permission of a file from within PHP.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
15
You use the fopen() function to open a handle to a file stream.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
16
The scandir() function sorts the returned entries in the order in which they are stored by the operating system.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
17
The three levels of access for files and directories are User, Group, and Other.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
18
The file_write_contents() function writes a text string as a file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
19
You append the \n carriage return escape sequence to the end of a line to identify the end of a line on a UNIX/Linux platform.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
20
The move_uploaded_file() function moves the uploaded file from its temporary location to the permanent destination.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
21
The second digit in the file permission code assigns permissions to the ____.
A) group
B) other
C) user
D) group / user
A) group
B) other
C) user
D) group / user
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
22
The a+ mode argument opens the specified file for reading only and places the file pointer at the beginning of the file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
23
The ____ function returns an indexed array containing the names of files and directories in the specified directory.
A) readdir()
B) opendir()
C) scandir()
D) closedir()
A) readdir()
B) opendir()
C) scandir()
D) closedir()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
24
When a text file contains a single block of text, the ____ function would read the entire contents of the file into a string.
A) file_read_contents()
B) file_open_contents()
C) file_extract_contents()
D) file_get_contents()
A) file_read_contents()
B) file_open_contents()
C) file_extract_contents()
D) file_get_contents()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
25
When you are finished with a file stream, you use the statement fopen($handle); to ensure that the file doesn't keep consuming space in your computer's memory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
26
When a form is posted, information from the uploaded file is stored in the ____ autoglobal array.
A) $_FILES[]
B) $_UPLOAD[]
C) FILE_UPLOAD[]
D) UPLOAD_FILES[]
A) $_FILES[]
B) $_UPLOAD[]
C) FILE_UPLOAD[]
D) UPLOAD_FILES[]
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
27
To prevent multiple users from modifying a file simultaneously, you need to use the file_lock() function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
28
The syntax for the copy_file() function is copy_file(source, destination).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
29
If you want to open a file for reading and writing and place the file pointer at the end of the file, you use a mode argument of "a+".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
30
The ____ constant instructs PHP to append data to any existing contents in a specified filename instead of overwriting it.
A) FILE_APPEND
B) FILE_ADD
C) FILE_INCLUDE
D) APPEND_TO_FILE
A) FILE_APPEND
B) FILE_ADD
C) FILE_INCLUDE
D) APPEND_TO_FILE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
31
You can use the delete() function to delete files.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
32
When you are finished working with a file stream, you use the ____ function to ensure that the file does not keep taking up space in your computer's memory.
A) file_close()
B) exit_file()
C) close_stream()
D) fclose()
A) file_close()
B) exit_file()
C) close_stream()
D) fclose()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
33
The ____ function reads the contents of a text file that stores each individual line as an element of an indexed array.
A) file()
B) get_file()
C) read_file()
D) open_file()
A) file()
B) get_file()
C) read_file()
D) open_file()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
34
You would use the file_put_contents() function to quickly replace the contents of a file or append data to the end of an existing file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
35
You can use the fwrite() function to incrementally write data to a text file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
36
Some operating systems always list two directory entries named "." and "..", which refer to the current directory and the directory that contains the current directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
37
One way to move a file in PHP is to copy with file with the copy() function, and then delete the original file with the unlink() function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
38
Using a value of ____ for the mode argument of the fopen() function opens the specified file for reading and writing and places the file pointer at the end of the file.
A) w
B) r
C) r+
D) a+
A) w
B) r
C) r+
D) a+
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
39
On a Macintosh platform, you append the ____ carriage return escape sequence to the end of the line.
A) \n
B) \r
C) \rn
D) \nr
A) \n
B) \r
C) \rn
D) \nr
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
40
The ____ function writes a text string and creates the file if it does not exist.
A) file_write_contents()
B) file_create_contents()
C) file_put_contents()
D) file_make_contents()
A) file_write_contents()
B) file_create_contents()
C) file_put_contents()
D) file_make_contents()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
41
A(n) ____________________ file is a series of characters or bytes for which PHP attaches no special meaning.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
42
The ____ argument of the fwrite() function allows you to specify the maximum number of bytes that should be written.
A) size
B) length
C) range
D) max_length
A) size
B) length
C) range
D) max_length
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
43
What function is used to delete files?
A) delete()
B) delete_file()
C) unlink()
D) del_file()
A) delete()
B) delete_file()
C) unlink()
D) del_file()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
44
What function returns a line, strips any XHTML tags the line contains, and then moves the file pointer to the next line?
A) fgetcsv(handle, length[, delimiter, string_enclosure])
B) stream_get_line)$handle, length, delimiter)
C) fgetss($handle, length[, allowed_tags])
D) fgets(handle[, length])
A) fgetcsv(handle, length[, delimiter, string_enclosure])
B) stream_get_line)$handle, length, delimiter)
C) fgetss($handle, length[, allowed_tags])
D) fgets(handle[, length])
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
45
Because the fopen() function must be used with the ____ function, you can specify what type of operations can be performed on the file and where and how the data will be written.
A) file_put_contents()
B) file_get_contents()
C) readfile()
D) fwrite()
A) file_put_contents()
B) file_get_contents()
C) readfile()
D) fwrite()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
46
The operational constant of the flock() function that opens the file with an exclusive lock for writing is the ____.
A) LOCK_EX
B) LOCK_SH
C) LOCK_NB
D) LOCK_UN
A) LOCK_EX
B) LOCK_SH
C) LOCK_NB
D) LOCK_UN
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
47
The owner of a resource, such as a file or directory, can usually grant ____________________ to access the resource.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
48
What function is used to copy the names of the files in a directory to an array?
A) readdir()
B) copydir()
C) scandir()
D) list_dir()
A) readdir()
B) copydir()
C) scandir()
D) list_dir()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
49
Two arguments, source and destination, are used with the ____ function.
A) copy()
B) copy_file()
C) file_copy()
D) dup_file()
A) copy()
B) copy_file()
C) file_copy()
D) dup_file()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
50
The ____ function should be used before deleting files and directories to determine if the file or directory name exists.
A) file_exists()
B) dir_exists()
C) file_dir_exists()
D) dir_file_exists()
A) file_exists()
B) dir_exists()
C) file_dir_exists()
D) dir_file_exists()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
51
Every time you use the ____ function, the file pointer moves to the next character in the file.
A) fgetc()
B) fopen()
C) fclose()
D) fileread()
A) fgetc()
B) fopen()
C) fclose()
D) fileread()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
52
With the exception of the ____ function, each time you call a function that iterates through a text file, the file pointer automatically moves to the next line in the text file.
A) fopen()
B) fclose()
C) fgetc()
D) feof()
A) fopen()
B) fclose()
C) fgetc()
D) feof()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
53
What function returns a value of true when the file pointer reaches the end of the file?
A) end_of_file()
B) feof()
C) eof()
D) file_end()
A) end_of_file()
B) feof()
C) eof()
D) file_end()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
54
A(n) ____________________ is assumed to have only printable characters and a small set of control or formatting characters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
55
PHP provides the ____________________ function for changing the permissions of a file within PHP.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
56
Instead of reading a large text file into PHP, you can use the ____ to iterate through a text file.
A) file handler
B) file pointer
C) data array
D) mode operator
A) file handler
B) file pointer
C) data array
D) mode operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
57
The ____ function only works when there are "." and ".." are the only two entries present in a directory.
A) del_directory()
B) rmdir()
C) delete_directory()
D) remove_directory()
A) del_directory()
B) rmdir()
C) delete_directory()
D) remove_directory()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
58
The two arguments required for the rename() function are ____.
A) previous_name,new_name
B) old_name,new_name
C) current_name,new_name
D) previous_name,current_name
A) previous_name,new_name
B) old_name,new_name
C) current_name,new_name
D) previous_name,current_name
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
59
What function returns a line that ends with a specified delimiter and moves the file pointer to the next line?
A) fgetcsv(handle, length[, delimiter, string_enclosure])
B) stream_get_line($handle, length, delimiter)
C) fgets(handle[, length])
D) fgetss(handle, length[, allowed_tags])
A) fgetcsv(handle, length[, delimiter, string_enclosure])
B) stream_get_line($handle, length, delimiter)
C) fgets(handle[, length])
D) fgetss(handle, length[, allowed_tags])
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
60
What function returns a line and moves the file pointer to the next line?
A) fgetc($handle)
B) fgetcsv(handle, length[, delimiter, string_enclosure])
C) fgets($handle[, length])
D) fgetss(handle, length[, allowed_tags])
A) fgetc($handle)
B) fgetcsv(handle, length[, delimiter, string_enclosure])
C) fgets($handle[, length])
D) fgetss(handle, length[, allowed_tags])
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
61
A(n) ____________________ link, which is identified with the is_link() function, is a reference to another file elsewhere on the system, not a file itself.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
62
Using a four-digit ____________________ (base 8) code will ensure that proper permissions are assigned.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
63
The ____________________ function incrementally writes data to a text file and returns the number of bytes written to the file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
64
The PHP ____________________ function will read a file from a disk and send it directly to the Web browser.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
65
An input field of ____________________ within a form presents the user with a file selection control.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
66
When downloading a file with PHP, you must provide the appropriate XHTML ____________________ to tell the client Web browser that a response contains more than just a Web page.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
67
Write permission normally implies ____________________ permission as well.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
68
The ____________________ function determines whether a filename specifies a directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
69
To iterate through the entries in a directory, you open a ____________________ to the directory with the opendir() function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
70
The ____________________ function can be used to return the names of the entries in the directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
71
In PHP, files are uploaded through ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
72
The currently selected record in a directory listing can be accessed using the directory ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
73
The ____________________ function reads the file and directory names from an open directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
74
The ____________________ function returns a value of TRUE if it successfully locks a file and FALSE if it fails.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
75
Adding a "b" to the end of the method argument of the fopen() function forces the file to be opened in ____________________ mode.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
76
Information about an uploaded file, such as error codes, temporary name, name, size, and type would be found in the ____________________ autoglobal array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
77
The ____________________ function is an alias for the fwrite() function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
78
A new directory can be created using the ____________________ function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
79
The move_uploaded_file() function is used to move an uploaded file from its ____________________ location to the permanent destination.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck
80
A ____________________ input field may be added to a form to set the maximum allowable upload file size.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 84 في هذه المجموعة.
فتح الحزمة
k this deck