I think you can just call the function "fstat" from your C code to determine if the file is present.
If you want to look at all the entries in /dev then you can use the opendir() and readdir() functions.
If your driver knows the names of the files to search for then you can hard-code that in the driver. If you need to allow the user to specify what to search for then you should implement the asynOctet interface to pass the name.
Mark
________________________________
From: [email protected] [[email protected]] on behalf of Vishnu Patel [[email protected]]
Sent: Wednesday, April 10, 2013 6:24 AM
To: [email protected]
Cc: [email protected]
Subject: Re: linux file search from Asyn
Hi,
I am ready using asynInt32 for reading and writing I/O channels of board. I want to add one addition functionality which tells operator that perticular board is present or not.
At my linux layer i am have one file correspoing to each board present in the system.
Example-
There are 2 board X and Y is present in the system.
then 2 files /dev/X and /dev/Y generated at boot time.
so if operator want to monitor presence of board X in the system. then if ASYN device support can search /dev/X then board X is in the system and if /dev/X doesn't exist, that means board X is not present in the system,
So if possible to search file from asyn EPICS device support layer or execute linux file search command from asyn EPICS layer, device support can give information by using BI record that the desirable board is present in the system or not.
Thanks & Regards
Vishnu
From: <[email protected]>
Sent: Wed, 10 Apr 2013 16:03:11
To: <[email protected]>
Cc: <[email protected]>
Subject: Re: linux file search from Asyn
Hi Vishnu,
Hi Vishnu,
It sounds like you need an asynPortDriver driver that has a writeOctet method that basically calls system(“string”) or execl( “path”, “arg”, ... ) and catches the response from stdout in the readOctet method. I don’t think such a beast exists but if you took the asynPortDriver documentation (http://www.aps.anl.gov/epics/modules/soft/asyn/R4-21/asynPortDriver.html) and the example I don’t think it would take long to write. You could then use StreamDevice or an asyn record to work out what to do with the reply.
I am posting this to techtalk in case anyone has done this as an exercise and not published it yet.
Cheers,
Nick Rees
Principal Software Engineer Phone: +44 (0)1235-778430
Diamond Light Source Fax: +44 (0)1235-446713
From: [email protected] [mailto:[email protected]]
Sent: 10 April 2013 10:24
To: Rees, Nick (DLSLtd,RAL,DIA)
Subject: Re: linux file search from Asyn
Hi Nick,
Actually i want to develop asyn based device support, so that EPICS PV have status of particular board is present or not in the system.
In my linux layer for each board one file is generated in /dev/XXX at boot time.
so if i can read the XXX file is present or not in /dev directory, EPICS PV can display the status of perticular board.
Thanks
With regards
Vishnu
From: <[email protected]>
Sent: Wed, 10 Apr 2013 13:48:48
To: <[email protected]>, <[email protected]>
Subject: Re: linux file search from Asyn
HI Vishnu,
You have to provide more information about what you want to do. Do you want to somehow implement an asyn support layer that implements a search (which I don't really understand) or do you just want to find where the asyn support code is in your file system. If the latter, the asyn device support file are in the asyn/devEpics directory of the asyn support module.
Cheers,
Nick Rees
Principal Software Engineer Phone: +44 (0)1235-778430
Diamond Light Source Fax: +44 (0)1235-446713
From: [email protected]<UrlBlockedError.aspx> [mailto:[email protected]<UrlBlockedError.aspx>] On Behalf Of Vishnu Patel
Sent: 10 April 2013 08:26
To: techtalk
Subject: linux file search from Asyn
Dear all,
I want to search specific linux file in ayn Device support layer. how is it possible?
Thanks
Get your own FREE website and domain with business email solutions, click here
[Image removed by sender.]<http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?>
Get your own FREE website and domain with business email solutions, click here<http://track.rediff.com/click?url=___http://hosting.rediff.com/rediffmailpro/business-email?sc_cid=sig___&cmp=sig&lnk=sig&nsrv1=host>
[http://sigads.rediff.com/RealMedia/ads/adstream_nx.ads/www.rediffmail.com/signatureline.htm@Middle]<http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?>
Get your own FREE website and domain with business email solutions, click here<http://track.rediff.com/click?url=___http://hosting.rediff.com/rediffmailpro/business-email?sc_cid=sig___&cmp=sig&lnk=sig&nsrv1=host>
- Navigate by Date:
- Prev:
Re: linux file search from Asyn Vishnu Patel
- Next:
Re: Conversion problem from double to 32 bit unsigned int (in ao) Benjamin Franksen
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: linux file search from Asyn nick.rees
- Next:
Re: linux file search from Asyn Vishnu Patel
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|