文件未在C中打开,但在Java中打开 [英] File not opening in c but it opens in java
本文介绍了文件未在C中打开,但在Java中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用以下代码打开文件
I tried to open a file using the following code
FILE *trans1;
trans1=fopen("/proc/binder/transcation_log","r");
我收到一个错误消息,当我尝试在Android(java)中打开相同文件时没有此类文件或目录,这是为什么?
实际上,在Java中,直接从此文件读取数据
I am getting an error that no such file or directory while when i try''ed to open the same file in Android(java) it opens,whats the reason?
Actually in java in reading data from this file directly
推荐答案
Linux中的/proc
伪文件系统是内核变量的接口.标准Linux内核不包含 Binder IPC [
The/proc
pseudo-filesystem in Linux is an interface to kernel variables. The standard Linux kernel doesn''t include Binder IPC[^], so there''s no/proc/binder
in non-Android Linux machines.
#include <stdio.h>
#include <conio.h>
void main() {
FILE *fp;
fp = fopen("MYFILE.txt", "a");
fprintf(fp, "%s\n ", "Hello World, Where there is will, there is a way.");
fclose(fp) ;
}
这篇关于文件未在C中打开,但在Java中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文