Creating File Flashcards

1
Q

What is the first step in creating a file?

A

Determine the type of file you want to create.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False: You must have the right permissions to create a file in a directory.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Fill in the blank: To create a text file in a command line interface, you can use the command ___.

A

touch filename.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following is a common file extension for a text file?

A

.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What command is used to create a file in a Unix-based system?

A

touch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What programming language uses the command ‘open’ to create a file?

A

Python

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the purpose of the ‘write’ method when creating a file in programming?

A

To write data to the file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

True or False: A file can be created without any content.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the ‘fs’ module in Node.js provide?

A

File system operations including file creation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In which programming language would you use ‘File.create()’ to create a file?

A

C#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a common method to create a file in Java?

A

Using the ‘File’ class and its ‘createNewFile()’ method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Fill in the blank: To create a new file in Windows, you can right-click in the directory and select ‘New’ -> ___.

A

Text Document

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the default mode when opening a file for writing in Python?

A

‘w’ (write mode)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Multiple Choice: Which command will NOT create a new file? A) touch B) echo C) rm D) cat

A

C) rm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the significance of the ‘append’ mode when creating a file?

A

It allows you to add content to an existing file without deleting its current content.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

True or False: You can create a file with the same name as an existing file in the same directory.

17
Q

What file creation method is used in PHP?

A

fopen() with ‘w’ mode.

18
Q

What is the command to create a new directory in Linux?

19
Q

Fill in the blank: In C++, you can create a file using the ___ class.

20
Q

What happens if you try to create a file that already exists in most programming languages?

A

It will either overwrite the file or raise an error, depending on the mode used.

21
Q

What does the term ‘file permissions’ refer to?

A

The settings that determine who can read, write, or execute a file.

22
Q

What is the purpose of the ‘with’ statement in Python when creating a file?

A

It ensures proper file closure after the file operations are complete.

23
Q

Multiple Choice: Which of the following is NOT a file type? A) .txt B) .doc C) .exe D) .file

24
Q

What command would you use to create a new file in PowerShell?

A

New-Item -ItemType File filename.txt

25
True or False: You can create a file in a read-only directory.
False