FileMonitor issue for date time stamp change.

Hi I have an app that runs with a minor issue and I am looking for some insight for a workaround or code change.
I have a File Monitor that checks a specific directory every second.
Users send a batch run to this directory throughout the day. There are two types of files, .ZIPs and .DONEs.
So for each .ZIP a .DONE is sent to notify the app it can begin to process the file.
Here is what I receive
/elements/process/File1.ZIP     Oct 15 08:19
/elements/process/File1.DONE     Oct 15 08:19
The problem I am encountering is sometimes the .DONE and. ZIP are sent and the date time stamp of both files are the same so when the monitor reads the directory it looks like there is no change so both files sit in the directory and do not process. To make this work, I usually go in and touch a file to change the date time stamp.
This is a java app that runs on an AIX box.
Here is my code, is there anything any once can suggest to help me out. Thanks in advance.
   * Subclass of FileMonitor, Handles the timer event
   * @param none
  private class FileMonitorNotifier extends TimerTask
    public void run()
      // Loop over the registered files and see which have changed.
      // Uses the Modifed DateTimeStamp to determine if there was a change.
      // Use a copy of the list in case listener wants to alter the
      // list within its fileChanged method.
        try
            Collection files = new ArrayList (hmFiles.keySet());
            for (Iterator i = files.iterator(); i.hasNext(); )
                File file = (File) i.next();
                long lastModifiedTime = ((Long) hmFiles.get (file)).longValue();
                long newModifiedTime  = file.exists() ? file.lastModified() : -1;
                //      Check if file has changed
                if (newModifiedTime != lastModifiedTime)
                    //      Register new modified time
                    hmFiles.put(file, new Long (newModifiedTime));
                    // Notify listeners
                    for (Iterator j = colListeners.iterator(); j.hasNext(); )
                        WeakReference reference = (WeakReference) j.next();
                        FileListener listener = (FileListener) reference.get();
                        // Remove from list if the back-end object has been GC'd
                        if (listener == null)
                            j.remove();
                        else
                            listener.fileChanged (file);
        catch(Exception ex)
             m_odLaunch.logError(OdIntegrationConstants.ERROR_LEVEL_MIDLEVEL, ex);
     }

Yes, I guess you are right, I don't care what time each file came, as long as I have both I can being to unzip and process and delete the .DONE.
The code itself was based on if a filechanged then do work.... I could just take this out. Thanks!
* This is the main entry point when there is a change to the modified date/time
*  of the monitor directory
* @param file directory we are monitoring
     public void fileChanged (File file)
          StringBuffer sbMessage;
          try
               sbMessage = new StringBuffer();
               //Make sure this is a Directory
               if(file.isDirectory())
                    //Return list of files with extension we are looking for
                    File[] arFiles = file.listFiles((FilenameFilter)new FileSuffixMonitor(m_odLauncher));
                    for(int i=0;i < arFiles.length;i++)
                         sbMessage.append("Found file association to move-" );
                         sbMessage.append(arFiles.toString());
                         m_odLauncher.logInstance(sbMessage.toString());
                         processMoveFile(arFiles[i]);
          catch(Exception ex)
          sbMessage = null;

Similar Messages

  • HCM Process & Forms: Date & Time Stamp issue in Prev Comments Box

    Hi
    We implemented HCM Process and Forms and we are in EHP4.  We need user name, date and time stamp in each step for audit purpose.
    Form Process Example:
    Step1: Manager -> Initiates a Form for employee pay/position changes  (REQUEST)
    Step2: 1-Up Manager -> Approves a Form for employee pay/position changes (APPROVE)
    Step3: HR Admin -> Process a Form for employee pay/position changes (PROCESS)
    Process Overview: HR Admin can open a form once all steps are completed and they want to see all 3 steps date & stamp here.
    New Comments -> To enter user comments in each step. Used data type HRASR_CURRENT_NOTE
    Previous Comments-> To display prev. step / user's comments including user name, date & time. Used data type HRASR_PREVIOUS_NOTES.
    I tried all different property settings in the form. May be I am still missing some property settings here.
    Issue:  If user enters any comments in "New Comments" box then only date & time stamp is coming along with their comments in "Previous Comments" otherwise not showing anything, just blank in the Prev. Comments.  I added some code in form script in case no data in "New Comments" then default a value ":" . It is working fine for first step but not working the same for other 2 steps.
    Trying in different way:
    Creating 3 text fields in a form just for display purpose and modifying each field (data set) with some text (combination of user name, system date and time) at each stage/step in a BADI.
    Method: IF_HRASR00GEN_SERVICE~DO_OPERATIONS
    Here it is updating correctly for first step/stage (REQUEST) and other 2 fields are not updating accordingly. I did debug for each step and updating the data set correctly but finally not dispalying the valuse in a form except first field.
    Can someone please share your ideas or inputs.
    Appreciate your time & help!
    Thanks
    Hari

    Hi Sahir
    Thank you for your reply.
    As I explained in my post, user details with date & stamp are coming when user enters some comments otherwise it is blank., All users may not enter comments because it is not a "required".
    HR is needed this for audit purpose, just at end of the process they need to see all user names, date & stamp in the form. Forget about comment boxes, Can't we make just simple text fields with user details for each step (all 3 stages)?
    FYI:
    Issue:  If user enters any comments in "New Comments" box then only date & time stamp is coming along with their comments in "Previous Comments" otherwise not showing anything, just blank in the Prev. Comments.  I added some code in form script in case no data in "New Comments" then default a value ":" . It is working fine for first step but not working the same for other 2 steps.
    Appreciate your inputs !
    Thanks
    Hari

  • LG Octane Camera Date/Time Stamp Issues

    The pics I take with my LG Octane are designated a number associated with the date/time the pic was taken (ex 0401121345, would be April 1, 2012 at 145pm). When I transfer the pics from my phones memory card to my computer and open the pics, I can see the pics info (date/time) and everything seems correct.
    The problem comes in when I load my pics onto a website that verifies the pics date/time thru the digital encoding on the pics file. (Digital Pics are encoded with date/time stamps that can be recognized with computer software). This website rejects my submitted pics from my LG Octane because this encoding is either not there or not set correctly. I had no issue previously when using my Samsung env last year. Please Help!

    I take it you are noticing that the photo shows in your gallery with the correct time for the name. But, when you look at the photos on your computer it is showing a time so many hours off (ie. phone shows 12:00 and computer shows 4:00). What it is actually doing is time stamping it for GMT for some reason.  This has been a problem for as long as I know. I have not found an answer and have come to believe there is not a way of changing the time/date stamp on the phone. I have not even found an app for it.
    Sorry I don't have an answer. But, maybe some one else will.

  • Need to add date/time stamp to file name without time change creating new files

    We have setup our application to save data once a trigger event occurs. We also need the date/time stamp as part of the file name. We used Format Date/Time String and concatenated it into the file name. It all works good, but as the time changes (seconds, minutes, etc.) it causes the Write to File to create a new file with the new filename. Is there a way to create the file and save/latch/buffer the time in the file name so that it doesn't create a new file for every second?
    I've attached a shot of the relevant part of our VI. It's all in a big while loop. The data save is in a case/switch so that when it is triggered it starts saving. (The for loop is to split the data up
    into 4 different files). Like I said, it all works except new files are created every second as the time changes instead of just putting it all in one file with the initial time in the file name.
    Attachments:
    TimeInFileNameQuestion.jpg ‏46 KB

    I need a loop in order to use a shift register. I cannot stop the outer while loop (because it would stop the hardware from collecting data), and I cannot add loops inside which bogs down the processor to where the app stops. I've attached a simpler version of my VI which illustrates the problem. While the button is pressed (the trigger) it should save the data (in this case just cycle numbers) into one file with the initial date/time. But, you can see that it creates 1 file/second. I tried using shift registers, but without adding extra loops I can't see how to do it. Thanks
    Attachments:
    FileNameTest.vi ‏29 KB

  • Need to change Date/Time stamp on jpeg file

    I combine images into panoramas using PTGUI. The problem is that the output image file is date stamped as the time that I created the image. I really want the date/time stamp to be the same as the images that go into the panorama. I cannot find a way in LR to change this.
    Lee

    > By the way, Victoria, should you be promoting your url here? It belongs in your profile. It's in the forum rules somewhere and others have been picked up on it before.
    >
    > Joe
    Oh, thanks Joe, I'll change that then. I did go looking for forum
    rules, but couldn't find any!
    Victoria

  • Auto Date/Time stamp required for Numbers 3.1

    I would like to automatically add a Date/Time stamp to the last column's cell, when a person's name is selected from the pop-up menu in Column C.
    As a number of different people will be using the spreadsheet, I'd prefer not to have a keyboard short cut, as it can be easily overlooked.
    I was wondering if it were possible to use a script to copy a cell's (column D) results, containing the 'NOW()' or 'TODAY()' function, and paste the results into the 2nd cell (Column E), allowing the last column's formula to reference the 2nd cell?
    The formula in the last cell   =if($C2="","",$E2)  can then reference a static cell, rather than a live cell.
    I know enough to be dangerous, so I'm not sure if i'm heading in the right direction.
    Thanking you all in advance.

    Hi Gordon,
    Is this the same as a script?
    Good question! It's fun to see people try to define what a service is. It may be one of the least understood and appreciated features on the Mac. It was certainly a mystery to me not long ago.
    I think of a service as anything that can be made to appear in the Services menu. Apple has made that easy with Automator. You fire up Automator, create a new service "workflow" document, plop in a script, save, and see the result immediately in the Services menu. You can also send the .workflow package to someone else, who only needs to double-click to install it.
    This particular date-time service contains a short AppleScript (you can view it by opening the .workflow in Automator.  But other languages (Python, Perl, etc) and Unix utilities can be used too, as illustrated here.
    Since Numbers has decent support for AppleScript, it is quite easy for the non-technical user to "bolt on" menu choices to do quite sophisticated things that are not built into the interface itself.  I find it more accessible than (and just as powerful as) the VBA used for Excel macros. But that could be mostly a matter of familiarity.  In any case, it adds a whole new dimension to Numbers.
    SG

  • HT2513 Is there a way to see who made an appointment and at what time/on what date they made it? Kind of like a date/time stamp for our network calendar?

    Is there a way to see who made an appointment and what time/on what date they made it? Kind of like a date/time stamp for our network version of iCal? Everyone has all rights and privledges to everyone else's calendar, and sometimes we need to know who did what to whose.

    Christine,
    You can also ask in the Typography forum,
    http://forums.adobe.com/community/design_development/typography?view=discussions&start=0
    The guy running whatfontis is a regular poster there.
    And apart from
    http://www.whatfontis.com/
    there are
    http://www.identifont.com/
    http://new.myfonts.com/WhatTheFont/
    and especially for script,
    http://www.bowfinprintworks.com/ScriptIDGuide.html

  • How do you vary the Date/Time stamp format in File Adapters

    In the receiver channel of the File Adapter where you specify the 'File Name Scheme', you do have the option of specifying a 'File Construction Mode' of 'Add Time Stamp'.  How can you specify a different Date/Time stamp format ( eg MM/DD/YY vs YYYYMMDD vs MMDDYY, etc. ) without changing the Date/Time stamp for the entire SAP system?  Also, can you control where the Date/Time stamp appears in the filename?

    Hi,
    There are many threads discussing the same issue. Go thro the following:
    Dynamic file name (Date) in Receiver File Adapter
    Receiver File Adapter - TimeStamp
    Bhavesh's reply in above thread:
    You can use Adapter Specific Identifiers and then change the file name in the mapping. Append the tiem stamp in the format that you want and so on.
    Just use this code in an UDF,
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = conf.get(key);
    java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
    dateformat.format( new java.util.Date() );
    String newfilename=SourceFileName+dateformat;
    // change to new file name
    conf.put(key, newfilename);
    return "";
    Regards,
    P.Venkat

  • Formatted Search - Date Time Stamps

    Hi,
    We are trying to use a Date & Time Stamp for two udf's of which I will then calculate the difference in a report. I have a couple of issues. Ideally the user would enter the Start field (udf1), click Shift-F2 and that udf would be populated with a Date/Time Stamp like: 07/12/09 14:30:00 or 07/12/09 02:30PM. The user would also do the same thing for the End field (udf), so I end up with two udf's that both hold a Date/Time Stamp described above.
    1 - It looks like I will either need two udf's each for both stamps, one for the Date (date field type) and one for the Time (hour field type)...or I will need to use an alphanumeric field type to hold the whole timestamp. When using the hour field type I still have some issues.
         and
    2 - I can't seem to get the right sql (sbo query) function to return the date/time stamp and / or I can't cast it or format it the way I would like.
    -If the udf is date field, I can use the GetDate function, but it doesn't seem to get the time with it or the field isn't big enough or formatted properly.
    -If the udf is an alphanumeric field, I cast the GetDate function as nvarchar and it returns the date/time stamp, but it is an alpha field and the date is Jul 21 2009  4:41PM. I don't like the Jul 21 2009 formatting
    -If I use two fields, one for date (date type) and one for time (hours type), the date is formatted the way I like, but the hours field doesn't display the AM or PM and my formatted search doesn't return military time (14:00 instead of 2:00PM), so I can't tell if 2:00 is morning or afternoon.
    So I guess my questions are pretty general...Am I using the correct field types? Any suggestions on what to use? Are there any other ways to format this data? Not all date functions or casts (time, smalldatetime) work in the sbo query so I am looking for options. Any suggestions on what functions or cast to use?
    Thanks

    Hi,
    As you already aware, within B1 you may not treat datetime field easily.  For one of your request: I don't like the Jul 21 2009 formatting.  You could use function such as
    Select CONVERT(nvarchar(30), GETDATE(),106)
    to change it to 21 Jul 2009.
    Thanks,
    Gordon

  • Retaining AVI date/time stamp during capture to pre 9.

    I have pre 9. When capturing DV from my camcorder, how do I get pre 9 to add the clips  time and date to the avi file properties like it does for jpg's. What I get is the date I captured it to the computer. If I add "date taken" to the properties shown, it remains blank.
    I realize the time/frame stamp changes throughout the clip but it should be able to show the initial date/time stamp, for example. I sort these travel clips by oldest date first and need to be able to match them to their itinerary locations. I have a small freeware app that will strip the date/time stamp from the meta data and then I can adjust the time/date in "Organizer" but I have 100's of clips so I'd rather not go that way. I know there app's that will encode the date/time stamp visibly on the image during capture but I don't want that as I make DVD's from the clips. Do you have any advice or suggestions? I have Win 7, 64 bit, 3.2 ghz, 2 core. Thanks, Rob.

    Premiere Elements won't do this.
    You'll need a third-party program called DV Date, downloadable from the web.

  • Save the file and give date & time stamp

    1. Reading the Excel file from the selection screen as a parameter.
    2. Using F.M. ALSM_EXCEL_TO_INTERNAL_TABLE reading Excel file into
        Internal table.
    3. Implementing the Business Logic.
    4. Move output to Final Internal table.
    5. Final internal table should generate a Flat file. By using GUI_DOWNLOAD.
    6. That flat file should be saved with the name and location given in the Excel.
    7. When ever I run the program output file will generate in the same location but with date and time stamp. Because I’m running the program for range of employees say initially I run for 1 – 10,000 employees next 10,001- 20,000 like that.
    Whenever I run for 2nd time it will overwrite the previous output, that’s the reason I’m using date and time stamp.
    Eg:
    PERSONAL Numbers              Name                                         Location
    00000001                 xxxxx-24.04.2007-10.30          C:\        
    00000002                 xxxxx-24.04.2007-10.35
    00000003                 xxxxx-25.04.2007-10.40
    00000004                                  xxxxx-25.04.2007-10.30
    Can any one help me how to save the file and give date & time stamp through hardcode?
    please help me in this issue.

    I am not clear with your problem. Based on the understanding of your question,
    there  can be two cases.
    1- U want to insert time stamp in the output file.
    2- Time stamp is already there, u just have to solve the overwriting issue.
    If your question goes with option 2, You can make use of import parameters
    <b>CONFIRM_OVERWRITE</b> : Which will ask for confirmation before overwriting.
    <b>APPEND</b> : which you can choose either to append the data to the existing file or overwrite it.
    Please inform if the issue is not resolved.
    Message was edited by:
            BINU RAJ BINU

  • Error messages when sending date-time stamp to Oracle Database

      I have a complex application that communicates with an Oracle database.  One of the table values that gets written to the table is a date-time stamp.  Until recently, the user only required a date, and this was never an error. (The format String used was %d-%b-%Y)  Now they need a time-stamp as well, so I attempted to edit the format string input of the format date/time string function to include the time. I have tried numerous format strings, each of which returns an error on execution.  Depending on which format I use, I get one of 3 different error messages.  The really odd thing is that both the date and time always get stored in Oracle without any problem (regardless of what date-time I use, as long as I include the date and any part of a time stamp - I get the entire timestamp even if I only include %I for the hour).  The only issue is that LabVIEW generates an ODBC error if I try to include the time to the date-time stamp.  In other words, teh date/time stamp writes to the Oracle database, but an ODBC error occurs every time.  I've included a word doc with screen captures of the format strings used, the resultant date/time stamps written to Oracle and the error messages generated within LabVIEW. Any advice would be most appreciated.
    Attachments:
    Summary of ODBC Error messages related to date-time stamp.doc ‏65 KB

    Oracle has a standard date format: 12-Mar-2009 that it accepts as a string, but if you want more than that, you need to use the todate() function. I used this string going into the standard LabVIEW ''Format date/time sting vi' 
    to_date('%d-%b-%Y %H:%M:%S', 'DD-MON-YYYY HH24:MIS') to create the value needed for Oracle.
    Then I use standard format string to create SQL: insert into mytable (mydate) values(%s) and select * from my table where mydate = %s using the string above for %s.
    I think you can also define a global format for all time strings but I haven't bothered figuring that out.

  • Oracle Role Creation Date time stamp

    Hi All ,
    Can anyone pls help me to find out the Date time stamp when a Role has been created into database .
    Your early response will be appreciable.
    Many thanks ,

    Hi,
    >>Actually I am searching through google to see the each column name description for sys.user$ but not able to find anything useful
    These base tables are not documented (public) ... It seems that PTIME column stores the time stamp information when the password's user has changed.
    SQL> create user myuser identified by myuser;
    User created.
    SQL> select
      2    name,
      3    to_char(ctime,'dd/mm/yyyy hh24:mi:ss') ctime,
      4    to_char(ptime,'dd/mm/yyyy hh24:mi:ss') ptime
      5  from
      6    user$
      7  where name='MYUSER';
    NAME            CTIME               PTIME
    MYUSER          30/04/2008 10:52:25 30/04/2008 10:52:25
    -- waiting some time ...
    SQL> alter user myuser identified by legatti;
    User altered.
    SQL> select
      2    name,
      3    to_char(ctime,'dd/mm/yyyy hh24:mi:ss') ctime,
      4    to_char(ptime,'dd/mm/yyyy hh24:mi:ss') ptime
      5  from
      6    user$
      7  where name='MYUSER';
    NAME            CTIME               PTIME
    MYUSER          30/04/2008 10:52:25 30/04/2008 10:53:08Cheers
    Legatti

  • Maintain Date/Time Stamp in Export as XML

    Hello,
    I've create a report which has a field as mm/dd/yyyy HH:mm.
    When I export as .TXT .CSV, Excel ect it maintains the format; however when I export as XML I loose the formate and it exports as mm/dd/yyyy 12:00:00
    The below in anyother format or in BusinessObjects would be 09/04/2007  10:38.
    <COLUMN INDEX="6" ID="4" TYPE="Date" FORMAT="m/d/yyyy  hh:mm:ss  AM/PM">Actual Start (Date & Time)</COLUMN>
    <CELL INDEX="6">9/4/2007 12:00:00 AM</CELL>
    Any thoughts?
    As well is it possible to customize tags of the exported XML so it is more of a XML document then a spreadsheet.

    Thank you!
    For the issue with the Date/Time stamp is this a bug in older versions? I am using BusinessObjects 6.1; the only time it does this is when exported as XML
    Cheers,
    Tim
    Edited by: Tim Whitehead on Jul 13, 2008 7:17 PM

  • How to add date/time stamp to PDF in Acrobat 9 Pro?

    Hello,
    I'd like to add a date/time stamp to a PDF so that when I print the document, the current date/time will be printed as well.  Is it possible to do this?  I found the following posting (http://forums.adobe.com/thread/502915), but am not able to get it to work for me.  I don't really know anything about using Javascript.  Any help would be much appreciated.
    Thanks!

    Not sure it will work, but you can try using the app.hideMenuItem() method. See reference here.

Maybe you are looking for