It might be extremely frivolous, but google searches are not helpful indeed.
In python official docs, it constantly refers file as fp:
with open(filename, "w") as fp:
fp.write()
What's does "p" stand for?
r. Opens a file for reading only. The file pointer is placed at the beginning of the file. This is the default mode.
The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing.
In your line of code, fp means "file pointer". In the C standard library, for example when using the fopen function to open a file, a FILE pointer is returned. FILE is a kind of structure that holds information about the file.
"fp" stands for "file pointer" and it was a pointer to a FILE
structure in C. The name "fp" just sort of stuck.
"fd" was an alternate ad usually indicated an unsigned integer, which was the offset of the referenced file in the "file table" (file descriptor).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With