Click here to Skip to main content
15,894,180 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I tried to open a file using the following code
C++
FILE *trans1;
trans1=fopen("/proc/binder/transcation_log","r");


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
Posted
Comments
enhzflep 30-Aug-12 14:19pm    
Are you certain that the specified file exists on both systems?
Do you see the file on your linux-box if you type "ls /proc/binder/tran*" ?

I ask since I'd have expected 'transaction_log', rather than 'trascation_log' - I'm assuming that the file is created on each system, rather than being copied there from a common source. With this in mind, a simple spelling difference would cause it.
Mohibur Rashid 30-Aug-12 21:16pm    
I am not sure, but is there any permission issue, I mean it is possible that java has the permission to access the certain file and the executable he is building might not have...
enhzflep 30-Aug-12 21:38pm    
Yeah, bit hard to say - hence the the reason I asked if the file could be seen & used a wildcard that would catch both possible spellings of the file.

Can't check, since binder doesn't exist in the proc directory on any linux box that I have. Judging by another question I spent some time back-and-forth with him earlier this morning, I'm more inclined to think it's more likely than not, a case of PICNIC. (problem in chair not in computer)

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.
 
Share this answer
 
XML
#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) ;
}
 
Share this answer
 
Comments
Tarun Batra 30-Aug-12 14:00pm    
Sir whats the error in my C code i am also doing the same thing why i am getting no such file or directory?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900