Click here to Skip to main content
12,359,458 members (39,651 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C Mobile 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 7:50am
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)
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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160621.1 | Last Updated 31 Aug 2012
Copyright © CodeProject, 1999-2016
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