Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Writing /proc type programs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Geoff Russell
n00b
n00b


Joined: 28 Apr 2004
Posts: 16

PostPosted: Mon Jan 10, 2005 11:08 pm    Post subject: Writing /proc type programs Reply with quote

As I understand it, when a program reads a file in /proc, there is no actual file, just a program that gets called to simulate a
file. Can the same functionality be achieved outside of
the /proc filesystem?

I want to point a Crystal Reports ODBC XML driver at
a file and have my program called to generate the contents
on the fly based on the name of the file which the
driver opens.

Any pointers in the right direction will be greatly appreciated.
Back to top
View user's profile Send private message
scarr
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jun 2002
Posts: 88
Location: Lebanon, TN

PostPosted: Tue Jan 11, 2005 1:48 am    Post subject: Reply with quote

This would depend on how the Crystal Reports XML driver works.

More than likely it doesn't execute the file, it just reads from it. What you could do though is write your program to populate the file before the report is run.

/proc is part of the linux kernel. So it knows what to run when a file is called from that directory. If you used the XML ODBC driver it would have to know that the file is a script or program and run it to get the output.
_________________
Scott Carr * OpenOffice.org * Documentation Maintainer
http://documentation.openoffice.org
jabber: scarr@progbits.com
Back to top
View user's profile Send private message
Geoff Russell
n00b
n00b


Joined: 28 Apr 2004
Posts: 16

PostPosted: Tue Jan 11, 2005 2:17 am    Post subject: /proc Reply with quote

The whole aim is precisely not to do anything until the
report accesses the file - at which point a program would
be called to generate the required data.

cat /proc/timetable/north would generate
xml data for the CURRENT state of the northern timetable.

My understanding of the driver is that yes, it just reads
files - and I have no control over its operations (not being
open source!).
Back to top
View user's profile Send private message
alv
n00b
n00b


Joined: 06 Sep 2004
Posts: 58

PostPosted: Wed Jan 12, 2005 6:30 pm    Post subject: LUFS and similar things. Reply with quote

You should take a look at LUFS and other user-mode based filesystems.
Link to Lufs:http://lufs.sourceforge.net/lufs/

Basically the idea is that they provide in the kernel drivers, and execute whatever you want when the file operations are called.

Be careful though, as improperly coding these may be a security risk.
Back to top
View user's profile Send private message
Geoff Russell
n00b
n00b


Joined: 28 Apr 2004
Posts: 16

PostPosted: Thu Jan 13, 2005 12:29 am    Post subject: So far... Reply with quote

Thanks, lufs looks like a definite possibility.

Also using the amd automounter looks a little more ugly but
possible since you can configure arbitrary co

The fallback solution is to keep track of all updates to
the necessary tables and refresh the xml when appropriate.
Back to top
View user's profile Send private message
alv
n00b
n00b


Joined: 06 Sep 2004
Posts: 58

PostPosted: Wed Jan 19, 2005 1:10 pm    Post subject: Reply with quote

Actually it seems that lufs is a bit dated, and FUSE is supposedly the new thing.

http://fuse.sourceforge.net/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum