PREV INDEX NEXT

Author: Unknown
Subject: File Descriptors
Date: Sunday, 15 Nov 2020, 17:49:43

When you change file descriptor 1 or 0 when reading or writing a file, how do we rever those file descriptors back to stdin or stdout. For example, when redirecting, I think we need to change fd 1 and 0 to the fd of whatever file is opened, but then we would need to change fd 1 and 0 back to its original right? Do we need to store the original fd values somewhere?
PREV INDEX NEXT