Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C Linux Android
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 8: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 OriginalGriff 295
1 DamithSL 295
2 Sergey Alexandrovich Kryukov 197
3 Peter Leow 155
4 Afzaal Ahmad Zeeshan 154
0 OriginalGriff 7,510
1 DamithSL 5,494
2 Sergey Alexandrovich Kryukov 4,954
3 Maciej Los 4,936
4 Kornfeld Eliyahu Peter 4,514


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100