How to know whether a file is opened  or not ?

Hi all,
How to know whether a file is opened by its editor or not ? File may be any of the type.

There are platform-dependent commands that tell whether a file (or directory, port etc.) is used by which processes.
[oracle@izsak ~]$ fuser .
.:                    9299c
[oracle@izsak ~]$ ps -p  9299 -f
UID        PID  PPID  C STIME TTY          TIME CMD
oracle    9299  9298  0 Apr25 pts/0    00:00:00 -bash
[oracle@izsak ~]$ ls -l $fn
-rw-r-----  1 oracle oinstall 111215876 Apr 25 19:05 /opt/oracle/product/AS/10g/R2/opmn/logs/OC4J~ebank~default_island~1
[oracle@izsak ~]$ fuser $fn
/opt/oracle/product/AS/10g/R2/opmn/logs/OC4J~ebank~default_island~1:  3746  3747  3748  3749  3750  3751  3752  3753  3754  3755  3756  3758  3761  3762  3765  3767  3769  3770  3771 18638 21605 21743 21744 21745 22140 22143
[oracle@izsak ~]$ ps -p 3746 -f
UID        PID  PPID  C STIME TTY          TIME CMD
oracle    3746 26427  0 Apr23 ?        00:00:01 /opt/oracle/product/AS/10g/R2/jdk/bin/java -server -Djava.security.policy=/opt...

Similar Messages

  • How to know whether the file is opened or not

    Hi All,
    In the file handling,
    Before writing OPEN DATA SET, I want to know the file is already opened or not.
    Please help me out in this regard.
    Thanks and regards,
    Mallareddy

    Hi,
    Please try GET DATASET statement.
    Syntax:
    GET DATASET dsn.
    Extras:
    1. ... POSITION pos
    2. ... ATTRIBUTES attr
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. For details, see File Interface.
    Effect
    Used to get the properties of a file already open.
    You can use this statement without additions to determine whether the file is open.
    If the file is not open, an exception of the type CX_SY_FILE_OPEN_MODE is triggered.
    Regards,
    Ferry Lianto

  • To check whether a file is open or not.

    Hi,
    I am using proc_listpidspath() to check whether a file is open or not by some application.
    It works in Leopard but not in Tiger.
    Can anyone suggest some function or solution so that i can check whether a file is open or not in Tiger.
    thanks.

    PersianKamran wrote:
    if i create a file
    File f = new File("path");
    f.createNewFile();
    Now i have created this file.. but i havent wrote any thing to it.. how can i determine that whether this file is empty or not..[Read the fine manual|http://java.sun.com/javase/6/docs/api/java/io/File.html#createNewFile()]
    Atomically creates a new, empty file named by this abstract pathname if and only if a file with this name does not yet exist. The check for the existence of the file and the creation of the file if it does not exist are a single operation that is atomic with respect to all other filesystem activities that might affect the file.
    Returns:
    true if the named file does not exist and was successfully created; false if the named file already exists So if it returns true, then the file is created and empty.
    Secondly, once i write some thing to file.. how can erase all the data from file ?deleting it will get erase the file and return you to the state you started from.
    Iif you don't want to create a new file, don't use the createNewFile() method and use the new FileOutputStream/close approach rather than the createNewFile()/delete() pair as already described in this thread.

  • How to know whether the javascript is disabled or not while loading the jsp

    Hi,
    My query is like how to know whether the javascript is disabled or not while loading the Application main JSP in Mozilla browser.
    I want some Java code or JavaScript code.

    To the point, just let JS fire a specific HTTP request inside the same session.
    This can be done in several ways. 1) Create a hidden <img> element and set the `src` attribute so that it will request a (fake) image from the server. The server just have to intercept on this specific request. 2) Fire an ajaxical request and let the server intercept on it. You can use a Filter for this which sets a token in the session scope to inform that the client has JS enabled.

  • How to know whether the phone is replaced or not?

    Dear All,
    Please help in how to know whether Iphone 5 is replaced or not? I came to know that on replacement, imei number gets changed. please make me aware.

    Nobody here can make you aware.  You need to contact Apple directly.

  • How to know whether my phone is unlocked or not

    how to know whether my iphone is unlocked or not.

    You don't know if you bought an unlocked iphone or not?
    What did you ask for?
    What does your reciept say?

  • How to know a Word File is open.

    I am opening a word file from oracle forms using webutil in the following way.
    APP := CLIENT_OLE2.CREATE_OBJ('WORD.APPLICATION');     
    DOCS := CLIENT_OLE2.INVOKE_OBJ(APP,'DOCUMENTS');
    ARGS := CLIENT_OLE2.CREATE_ARGLIST;
    CLIENT_OLE2.ADD_ARG(ARGS,V_FILE_NAME);
    DOC := CLIENT_OLE2.INVOKE_OBJ(DOCS,'OPEN',ARGS);
    CLIENT_OLE2.DESTROY_ARGLIST(ARGS);
    CLIENT_OLE2.SET_PROPERTY(APP,'VISIBLE',1);
    after that the user may close the word application.
    When I try to quit word application
    CLIENT_OLE2.INVOKE(app,'Quit',ARGS);
    I am getting error since the application is already close by the user.
    Before issuing the 'Quit' command I want to know whether the word file opened or not.
    Or else I want to catch the error raised by 'Quit' command.

    hi
    try something like this.
    DECLARE
    app CLIENT_OLE2.OBJ_TYPE;
    docs CLIENT_OLE2.OBJ_TYPE;
    doc CLIENT_OLE2.OBJ_TYPE;
    selection CLIENT_OLE2.OBJ_TYPE;
    args CLIENT_OLE2.LIST_TYPE;
    BEGIN
    -- create a new document
    app := CLIENT_OLE2.CREATE_OBJ('Word.Application');
    CLIENT_OLE2.SET_PROPERTY(app,'Visible',1);
    docs := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Documents');
    doc := CLIENT_OLE2.INVOKE_OBJ(docs, 'add');
    selection := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Selection');
    -- insert data into new document from long item
    CLIENT_OLE2.SET_PROPERTY(selection, 'Text', :long_item);
    -- save document as example.doc
    args := CLIENT_OLE2.CREATE_ARGLIST;
    CLIENT_OLE2.ADD_ARG(args, 'c:\temp\example.doc');
    CLIENT_OLE2.INVOKE(doc, 'SaveAs', args);
    CLIENT_OLE2.DESTROY_ARGLIST(args);
    -- close example.doc
    args := CLIENT_OLE2.CREATE_ARGLIST;
    CLIENT_OLE2.ADD_ARG(args, 0);
    CLIENT_OLE2.INVOKE(doc, 'Close', args);
    CLIENT_OLE2.DESTROY_ARGLIST(args);
    CLIENT_OLE2.RELEASE_OBJ(selection);
    CLIENT_OLE2.RELEASE_OBJ(doc);
    CLIENT_OLE2.RELEASE_OBJ(docs);
    -- exit MSWord
    CLIENT_OLE2.INVOKE(app,'Quit');
    END;sarah

  • How to know whether tomcat server is up or not..?

    I have developed a java webstart application.In that,I need to include a component in a frame that shows whether the appplication is connected to the server(tomcat) or not.If it is connected to server,then a green light is up,if not red light is up.It should show the connection status althrough the application.I browsed through the apache documentation of Catalina class, http://tomcat.apache.org/tomcat-4.1-oc/catalina/docs/api/org/apache/catalina/startup/Catalina.html ,thinking that it could help me out.But I couldn't find it useful.So,I need a way to know whether the application is connected to server or not.Is there anyway to do it?Thanks in advance..!

    hell2heaven wrote:
    Yes I need both first and second case,there exists some server listening on a particular port and he can send some request and get some response from it.Well, the second implies the first, so unless you're interested in "The port is active, but the server isn't running properly," testing the second is sufficient--the first won't provide any additional information.
    Here my server is apache tomcat and it is running on port 8085.Actually,what happens in the application is when user inputs data via text field,a connection is opened to the appropriate servlet and object is passed to the servlet through that established connection.then servlet returns another object reporting the result,what happened on the server side.I want user to feel sure that he can send data to the servlet running on tomcat successfully.Am I clear enough now..?
    Not really.
    And if you're saying, "I want to see if the server is running before the user sends a request," that's pointless. Just send the request. If it succeeds, the server is running. If it fails, the server is not running or is unreachable or had some error. If you test first and it comes back good, the server can still go down between your test and the "real" request.

  • How to know if a file browser item is not null using javascript fucntion

    Hi
    <br><br>
    I tried to use javascript for validation. I have a file browser item named P55_FILE_NAME and I would like to know if this item is null or not before submit.
    <br>
    I wrote this function :<br><br>
    function validate_import(f_n){<br>
         if (trim(document.getElementByName(f_n).src) == "")<br>
         {<br>
         alert ("File name is empty.");<br>
         document.getElementByName(f_n).focus();<br>
         }<br>
         else{<br>
         doSubmit('SUBMIT');<br>
         }<br>
    } <br><br>
    When I press submit button I got an error, sounds like the src method does not exist in my input item. <br>
    Then, I looked my source page an I found this :<br><br>
    input type="file" name="p_t01" size="30"
    <br><br>
    there is know src method and the name is not P55_FILE_NAME and I don't want to use <b>p_t01</b> that will change.<br>
    <br>
    I need your help.<br>
    Benn

    Hello,
    The p_txx notation is the internal name the ApEx engine attaches to each page item. It starts with p_t01 (for the first item on page) and can end with p_t99 (hence, the max 99 items per page limit). You can see these names in your HTML source code.
    The bug in the File Browse item (fixed in version 2.2) is that the ID of the item is the internal name instead of the item name. Hence, in order to use DOM, you need to use this internal notation.
    If the File Browse item id is p_t01, you can null its content by using something like that (V2.0 notation) :
    html_GetElement('p_t01').value = '';I'm using the same, and similar code, for manipulating this type of item with no problems.
    Please document the use of this workaround, as when you'll upgrade your ApEx system, you will have to change this code back to the standard – item id equal item name.
    (Please follow Scott's advise, and keep your logic connected issues on the same thread. It will get you more quick and accurate help).
    Regards,
    Arie.

  • How to know whether all Idocs sent perfectly or not to target System

    Hi All,
    We are sending the Material Master Idocs via XI and to WMS File system ( Idoc-XIFile)
    How can a business user confirm that all the sent Idocs are reached to WMS by End of the day.
    Is there any way to match or any report kind of thing for this please
    Regards
    Vamsi

    HI vamsi,
    Following  is the solution that we are using >
    1. There is a separate interface ( file to idoc )that runs at the end of the business day..
    This interface will pick up a file ( from say ur WMS system) and post an idoc STATUS.SYSTAT01
    the file in this case will have the idoc number of the material idoc and the status( say 11 for OK ) and the same will be mapped to idoc.
    This idoc in turn will change the status of the material idoc from 03 to 11 . Then a filter can be made on this to find out which idocs did not reach status 11..
    however here there are chances that this ack interface can go in error as well
    2.  Or u can have a separate interface ( file to Proxy ) ..here the difference would be that single file will have all the idoc numbers that were received during that day and then in the proxy u can write abap code to change the status of those idocs to say status OK
    Edited by: Tarang Shah on Feb 6, 2010 8:05 PM
    Edited by: Tarang Shah on Feb 6, 2010 8:06 PM
    Edited by: Tarang Shah on Feb 6, 2010 8:14 PM

  • How to know whether Caps Lock Is On or Not

    Hi
    My application is in Foms 6i and oracle 9i. In logon screen , i want show toltip
    if caps lock is on stating that 'Caps lock is on.'. It should occur at the start of the logon form without entering any data( or after filling Userid an also do)
    How do I implement this.
    Regards,
    Subhash

    Also see
    Find whether the caps lock is on or off

  • How to know whether a connection leak occured in weblogic8.1

    How to Know whether Conenction Leak has Occured or Not ??..Where does the WeblogicServer8.1 print the STACK TRACE if connection Leak has occured ? or does it maintain a LOG FILE , where any entries can be seen................

    To turn on Debug flags add these to the startup scripts.
    -Dweblogic.Debug=weblogic.JDBCConn="true",weblogic.JTAJDBC="true"
    Essentially, you will need to edit the config.xml file (when the server is down) and add the proprty to the ConnectionPool definition:
    http://e-docs.bea.com/wls/docs61/config_xml/mbeans.html
    ConnLeakProfilingEnabled="true"
    Thanks and regards,
    Pazhanikanthan. P

  • How to know whether file is document file or not and page count

    How can i know whether the file is document file
    Eg: File file = new File("test.text"); 
            File file = new File("test.doc"); 
            File file = new File("test.pdf");   etc should return true
    File file = new File("test.exe"); 
           File file = new File("test.dat");  etc should return false
    and if it is true i should get the page count for example if pdf or doc file is containinf 100 pages
    i should get the value 100 is there any way to acheive this in java pls give some idea or example code
    Regards

    To get the number of pages you would need to write or find an existing Java API that can parse the proprietary formats of each type. And some formats do not really have pages. For instance, the number of pages of a .txt (often opened by Notepad by default) file would depend on your page length which is not generally stored in the file it is set by the tool you use to read the file.

  • How to know whether the current database is using a password file or not?

    How to know whether the current database is using a password file or not?

    The remote_password_file is the parameter that determines if you can use or not a password file. The values this parameter can have are NONE, SHARED, EXCLUSIVE. It is pretty obvious, if it is set to either SHARED or EXCLUSIVE the oracle instance has enabled the access through a password file for the SYSDBA and SYSOPER roles.
    ~ Madrid

  • What determines how a PDF or EPS file is opened??????

    Hi I was wondering if anyone can tell, what determines how a PDF or EPS is opened in Photoshop.
    If I open a PDF in photoshop, the first thing that pops up is the settings for which you want it to open. i.e., color mode, resolution, you choose what you want and then open.
    I always thought that how the file was created determines the initial settings in which photoshop displays in that little dialogue box. (for example, if I open an illustrator eps file that I created in photoshop, it always prompts the correct settings (300dpi, CMYK) I click open and it works great.
    But when I open a PDF in photoshop it always displays the color mode as RGB, not cmyk. Which i find odd, because I know there is no RGB color space in the PDF.
    Today something weird happend, I created an Ad in Indesign, every image I am certain was 300 dpi, and the rest are vectors. Exported it to PDF with high resolution settings, but when I opened it up in Photoshop, the settins dialogue box promted it as 72dpi, which again I find odd because I know each image is 300, the rest are vectors, and I know the PDF preset to which I exported it creates high res images.
    Does anyone know what determines how a PDF or eps file is opened in Photoshop and why photoshop is rendering a PDF in which I am certain is hi res, to a low res?
    Thanks for any help. Kevin

    >Hi I was wondering if anyone can tell, what determines how a PDF or
    >EPS is opened in Photoshop.
    Nothing, really. EPS provides this info openly in its header, but it is not always right, so PS cannot even assume it would be correct to use that info. For PDF it's a different story. PDF is a container format that can contain any number of items in mixed resolutions and colorspaces, hence PS cannot assume anything. Likewise, you can have multiple pages, links, multimedia content, all of which may influence the result upon display or rasterization...
    Mylenium

Maybe you are looking for

  • Script for replacing Image from a frame into InDesign document file

    Hi All, I am having an indesign document (indd) file with images and texts. I am using InDesign Server CS4 to run the scripts via SOAP. My requirement is to replace any of the images from the required frame/s of indesign document through scripting (I

  • Want to create a workflow with multiple reminders mail

    Hi Gurus, I have created a workflow,will  trigger  when a user status is changed.It will send a mail to next level person for approval.( I am only using a event,and send mail .because in my case it is not complesary to go to sbwp.Sending mail itself

  • Can't create reminders in my iPod

    My iPod touch 5g running iOS 7.0.4 is having a problem creating reminders . The reminders cannot be created in the app and not even by Siri . Nowadays my iPod is starting to lag . It lags at typing also . Can you please give me a solution for reminde

  • How I can change this query to group correctly

    This query return the right results for an individual pidm, (SPRIDEN_PIDM = 42306) but not when I run it for all the pidms in the table I get something like this which is fine, 42306 Z00717850 2 42306 Z00630015 1 42306 Z00822647 3 I want to be able t

  • Oracle Terminal, key mapping

    Hi everyone, This is my problem, I would like to use KEY-Fn triggers. I used Oracle Terminal to change my Fmruws.res file but I think that It is not enough because they don't work at all. I know that F10 fire KEY-COMMIT but what can I do with the res