What is the main difference between a temporary file and a regular file in the Linux world?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
What is the main difference between a temporary file ("tempfile") and a regular file in the Linux world?
The only main difference I recon between these two inodes is that in general, a "temporary file" has a much shorter life cycle than a "regular file", from whatever reason, while both are by principle, practically temporary (at least from the fact this universe is heading to a total heat death).
After reading an answer to this question, I think that newbies like myself should go read these sessions, respectively:
How does a pipe differ from a temporary file?
How does a FIFO (named pipe) differs from a regular pipe (unnamed pipe)?
files
add a comment |Â
up vote
0
down vote
favorite
What is the main difference between a temporary file ("tempfile") and a regular file in the Linux world?
The only main difference I recon between these two inodes is that in general, a "temporary file" has a much shorter life cycle than a "regular file", from whatever reason, while both are by principle, practically temporary (at least from the fact this universe is heading to a total heat death).
After reading an answer to this question, I think that newbies like myself should go read these sessions, respectively:
How does a pipe differ from a temporary file?
How does a FIFO (named pipe) differs from a regular pipe (unnamed pipe)?
files
Feel free to answer your own question, but please separate the Question and the Answer. Don't answer it in the question. This way, others can upvote (or downvote) your answer independently of the question you've asked.
â roaima
Apr 11 at 12:17
I agree, no problem, I just wanted to say what I understand so far.
â user9303970
Apr 11 at 12:20
"practically temporary"? Some files in my/etc/
are many years old, both by mtime and ctime. I'd hardly call them temporary in practice.
â ilkkachu
Apr 11 at 12:31
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
What is the main difference between a temporary file ("tempfile") and a regular file in the Linux world?
The only main difference I recon between these two inodes is that in general, a "temporary file" has a much shorter life cycle than a "regular file", from whatever reason, while both are by principle, practically temporary (at least from the fact this universe is heading to a total heat death).
After reading an answer to this question, I think that newbies like myself should go read these sessions, respectively:
How does a pipe differ from a temporary file?
How does a FIFO (named pipe) differs from a regular pipe (unnamed pipe)?
files
What is the main difference between a temporary file ("tempfile") and a regular file in the Linux world?
The only main difference I recon between these two inodes is that in general, a "temporary file" has a much shorter life cycle than a "regular file", from whatever reason, while both are by principle, practically temporary (at least from the fact this universe is heading to a total heat death).
After reading an answer to this question, I think that newbies like myself should go read these sessions, respectively:
How does a pipe differ from a temporary file?
How does a FIFO (named pipe) differs from a regular pipe (unnamed pipe)?
files
edited Apr 11 at 12:25
ilkkachu
48.5k669134
48.5k669134
asked Apr 11 at 12:04
user9303970
116224
116224
Feel free to answer your own question, but please separate the Question and the Answer. Don't answer it in the question. This way, others can upvote (or downvote) your answer independently of the question you've asked.
â roaima
Apr 11 at 12:17
I agree, no problem, I just wanted to say what I understand so far.
â user9303970
Apr 11 at 12:20
"practically temporary"? Some files in my/etc/
are many years old, both by mtime and ctime. I'd hardly call them temporary in practice.
â ilkkachu
Apr 11 at 12:31
add a comment |Â
Feel free to answer your own question, but please separate the Question and the Answer. Don't answer it in the question. This way, others can upvote (or downvote) your answer independently of the question you've asked.
â roaima
Apr 11 at 12:17
I agree, no problem, I just wanted to say what I understand so far.
â user9303970
Apr 11 at 12:20
"practically temporary"? Some files in my/etc/
are many years old, both by mtime and ctime. I'd hardly call them temporary in practice.
â ilkkachu
Apr 11 at 12:31
Feel free to answer your own question, but please separate the Question and the Answer. Don't answer it in the question. This way, others can upvote (or downvote) your answer independently of the question you've asked.
â roaima
Apr 11 at 12:17
Feel free to answer your own question, but please separate the Question and the Answer. Don't answer it in the question. This way, others can upvote (or downvote) your answer independently of the question you've asked.
â roaima
Apr 11 at 12:17
I agree, no problem, I just wanted to say what I understand so far.
â user9303970
Apr 11 at 12:20
I agree, no problem, I just wanted to say what I understand so far.
â user9303970
Apr 11 at 12:20
"practically temporary"? Some files in my
/etc/
are many years old, both by mtime and ctime. I'd hardly call them temporary in practice.â ilkkachu
Apr 11 at 12:31
"practically temporary"? Some files in my
/etc/
are many years old, both by mtime and ctime. I'd hardly call them temporary in practice.â ilkkachu
Apr 11 at 12:31
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
There is absolutely no difference between a temporary file and a regular file.
A temporary file is a regular file, and a regular file is "regular" as opposed to being a directory, or a device special file, or named pipe etc.
The only difference is, as you point out, the typical use of the file. When a program or script creates a "temporary file", it is typically a regular file that is used to store temporary data that is not needed beyond the lifetime of the process that created it. Such files are often created in $TMPDIR
.
POSIX defines:
File: An object that can be written to, or read from, or both. A file has certain attributes, including access permissions and type. File types include regular file, character special file, block special file, FIFO special file, symbolic link, socket, and directory. Other types of files may be supported by the implementation.
Regular file: A file that is a randomly accessible sequence of bytes, with no further structure imposed by the system.
It does not, however, care to say anything about the definition of a "temporary file", because it's not a specific file type (rather, a way of using regular files).
add a comment |Â
up vote
1
down vote
There is no technical difference between a temporary file and a regular file.
Semantically it would be reasonable to assume the following statements:
- A temporary file should be short-lived
- A temporary file may be intentionally deleted from the filesystem (by the application itself) while it is still in use
- A long-lived temporary file may be unexpectedly deleted from the filesystem (by a cleanup process) while it is still in use
- A temporary file should usually be created under
/tmp
or/var/tmp
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
There is absolutely no difference between a temporary file and a regular file.
A temporary file is a regular file, and a regular file is "regular" as opposed to being a directory, or a device special file, or named pipe etc.
The only difference is, as you point out, the typical use of the file. When a program or script creates a "temporary file", it is typically a regular file that is used to store temporary data that is not needed beyond the lifetime of the process that created it. Such files are often created in $TMPDIR
.
POSIX defines:
File: An object that can be written to, or read from, or both. A file has certain attributes, including access permissions and type. File types include regular file, character special file, block special file, FIFO special file, symbolic link, socket, and directory. Other types of files may be supported by the implementation.
Regular file: A file that is a randomly accessible sequence of bytes, with no further structure imposed by the system.
It does not, however, care to say anything about the definition of a "temporary file", because it's not a specific file type (rather, a way of using regular files).
add a comment |Â
up vote
3
down vote
accepted
There is absolutely no difference between a temporary file and a regular file.
A temporary file is a regular file, and a regular file is "regular" as opposed to being a directory, or a device special file, or named pipe etc.
The only difference is, as you point out, the typical use of the file. When a program or script creates a "temporary file", it is typically a regular file that is used to store temporary data that is not needed beyond the lifetime of the process that created it. Such files are often created in $TMPDIR
.
POSIX defines:
File: An object that can be written to, or read from, or both. A file has certain attributes, including access permissions and type. File types include regular file, character special file, block special file, FIFO special file, symbolic link, socket, and directory. Other types of files may be supported by the implementation.
Regular file: A file that is a randomly accessible sequence of bytes, with no further structure imposed by the system.
It does not, however, care to say anything about the definition of a "temporary file", because it's not a specific file type (rather, a way of using regular files).
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
There is absolutely no difference between a temporary file and a regular file.
A temporary file is a regular file, and a regular file is "regular" as opposed to being a directory, or a device special file, or named pipe etc.
The only difference is, as you point out, the typical use of the file. When a program or script creates a "temporary file", it is typically a regular file that is used to store temporary data that is not needed beyond the lifetime of the process that created it. Such files are often created in $TMPDIR
.
POSIX defines:
File: An object that can be written to, or read from, or both. A file has certain attributes, including access permissions and type. File types include regular file, character special file, block special file, FIFO special file, symbolic link, socket, and directory. Other types of files may be supported by the implementation.
Regular file: A file that is a randomly accessible sequence of bytes, with no further structure imposed by the system.
It does not, however, care to say anything about the definition of a "temporary file", because it's not a specific file type (rather, a way of using regular files).
There is absolutely no difference between a temporary file and a regular file.
A temporary file is a regular file, and a regular file is "regular" as opposed to being a directory, or a device special file, or named pipe etc.
The only difference is, as you point out, the typical use of the file. When a program or script creates a "temporary file", it is typically a regular file that is used to store temporary data that is not needed beyond the lifetime of the process that created it. Such files are often created in $TMPDIR
.
POSIX defines:
File: An object that can be written to, or read from, or both. A file has certain attributes, including access permissions and type. File types include regular file, character special file, block special file, FIFO special file, symbolic link, socket, and directory. Other types of files may be supported by the implementation.
Regular file: A file that is a randomly accessible sequence of bytes, with no further structure imposed by the system.
It does not, however, care to say anything about the definition of a "temporary file", because it's not a specific file type (rather, a way of using regular files).
answered Apr 11 at 12:18
Kusalananda
102k13199316
102k13199316
add a comment |Â
add a comment |Â
up vote
1
down vote
There is no technical difference between a temporary file and a regular file.
Semantically it would be reasonable to assume the following statements:
- A temporary file should be short-lived
- A temporary file may be intentionally deleted from the filesystem (by the application itself) while it is still in use
- A long-lived temporary file may be unexpectedly deleted from the filesystem (by a cleanup process) while it is still in use
- A temporary file should usually be created under
/tmp
or/var/tmp
add a comment |Â
up vote
1
down vote
There is no technical difference between a temporary file and a regular file.
Semantically it would be reasonable to assume the following statements:
- A temporary file should be short-lived
- A temporary file may be intentionally deleted from the filesystem (by the application itself) while it is still in use
- A long-lived temporary file may be unexpectedly deleted from the filesystem (by a cleanup process) while it is still in use
- A temporary file should usually be created under
/tmp
or/var/tmp
add a comment |Â
up vote
1
down vote
up vote
1
down vote
There is no technical difference between a temporary file and a regular file.
Semantically it would be reasonable to assume the following statements:
- A temporary file should be short-lived
- A temporary file may be intentionally deleted from the filesystem (by the application itself) while it is still in use
- A long-lived temporary file may be unexpectedly deleted from the filesystem (by a cleanup process) while it is still in use
- A temporary file should usually be created under
/tmp
or/var/tmp
There is no technical difference between a temporary file and a regular file.
Semantically it would be reasonable to assume the following statements:
- A temporary file should be short-lived
- A temporary file may be intentionally deleted from the filesystem (by the application itself) while it is still in use
- A long-lived temporary file may be unexpectedly deleted from the filesystem (by a cleanup process) while it is still in use
- A temporary file should usually be created under
/tmp
or/var/tmp
answered Apr 11 at 12:16
roaima
39.4k545106
39.4k545106
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f436995%2fwhat-is-the-main-difference-between-a-temporary-file-and-a-regular-file-in-the-l%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Feel free to answer your own question, but please separate the Question and the Answer. Don't answer it in the question. This way, others can upvote (or downvote) your answer independently of the question you've asked.
â roaima
Apr 11 at 12:17
I agree, no problem, I just wanted to say what I understand so far.
â user9303970
Apr 11 at 12:20
"practically temporary"? Some files in my
/etc/
are many years old, both by mtime and ctime. I'd hardly call them temporary in practice.â ilkkachu
Apr 11 at 12:31