Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: CLinuxAndroid
I tried to open a file using the following code
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 30-Aug-12 7:50am
Comments
enhzflep at 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 at 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 at 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)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

#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) ;
}
  Permalink  
Comments
Tarun Batra at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 838
1 OriginalGriff 461
2 Tadit Dash 355
3 sanket saxena 329
4 Peter Leow 228
0 Sergey Alexandrovich Kryukov 12,109
1 OriginalGriff 7,326
2 Peter Leow 5,003
3 Abhinav S 4,003
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web04 | 2.8.140421.2 | Last Updated 31 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid