Are there all types of files that can be opened with notepad like .txt, .c or .java the same ones that can be opened with fopen()
or is there any exception?
是否可以使用.ept,.c或.java等记事本打开所有类型的文件,可以使用fopen()打开相同的文件或是否有任何异常?
1 个解决方案
#1
3
The short answer is that C does not care about file types and therefore your assumption is true.
简短的回答是C不关心文件类型,因此您的假设是正确的。
The long answer is that the short answer only applies to regular files (all of the ones listed by you are regular files), in some cases it does not apply to special files like device files, FIFOs. On Windows, you might have an issue with links (.lnk
files), depending on your C library. The C library might not follow those links whereas Notepad will.
答案很简单,简短答案仅适用于常规文件(您列出的所有文件都是常规文件),在某些情况下,它不适用于特殊文件,如设备文件,FIFO。在Windows上,您可能会遇到链接(.lnk文件)问题,具体取决于您的C库。 C库可能不会遵循这些链接,而Notepad会。
That does however not mean that the file in question will be displayed correctly. Encoding and/or linebreaks might be an issue.
但这并不意味着将正确显示相关文件。编码和/或换行可能是一个问题。
#1
3
The short answer is that C does not care about file types and therefore your assumption is true.
简短的回答是C不关心文件类型,因此您的假设是正确的。
The long answer is that the short answer only applies to regular files (all of the ones listed by you are regular files), in some cases it does not apply to special files like device files, FIFOs. On Windows, you might have an issue with links (.lnk
files), depending on your C library. The C library might not follow those links whereas Notepad will.
答案很简单,简短答案仅适用于常规文件(您列出的所有文件都是常规文件),在某些情况下,它不适用于特殊文件,如设备文件,FIFO。在Windows上,您可能会遇到链接(.lnk文件)问题,具体取决于您的C库。 C库可能不会遵循这些链接,而Notepad会。
That does however not mean that the file in question will be displayed correctly. Encoding and/or linebreaks might be an issue.
但这并不意味着将正确显示相关文件。编码和/或换行可能是一个问题。