Finding the oldest file in a directory

I have a log directory that can have a lot of files in it. How can easily find the oldest file out of a large group of files in the directory so that I can delete it. The file name is of the form xxxx.*
I believe I can use a filter to get a list of files in the directory eith file name xxxx.* and then go through the list one by one and check the time stamp of the file and keep the name of the oldest one I find. Is there an easier way to just have these files ordered by modification date in acending order?

check the File class docs. There is a method called lastModified() you can write some simple code that can keep track of the file with the oldest date.

Similar Messages

  • Find The Txt Files in root directory

    Iin Sql if we want to check a text fiile in root directory (D:\windows\commands\dil.txt) exists or not what is right way or right command for it
    Thanks in Advance

    Oracle beginner wrote:
    utl_file.fgetattr('D:\windows\commands\', 'dil.txt', ex, flen, bsize);Wrong. Common mistake in thinking that the directory can be specified like that. It cannot. *+
    Oracle does not allow direct access to server directories as this will be a security violation.
    Instead, Oracle allows you to define a directory object that refers to a specific server directory. Once defined, read and write access on this object can be granted to schemas.
    This then provides a security mechanism - requiring PL/SQL code to use a directory object and have access (read and/or write) to the object.
    Secondly, it also support abstraction of the actual physical directory path. For example, the application code can use the directory object CSV_FILES - and the actual location can be implementation specific and differ from the mainframe Oracle server, to the Unix Oracle server to the Windows Oracle server.
    Details on FGETATTR are in [Oracle® Database PL/SQL Packages and Types Reference|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#i1003488] guide.
    * Please note that the old style utl_file_dir parameter has been discontinued in Oracle and its use is not recommended by Oracle and constitutes a pretty serious security violation if used.

  • Cannot find the configuration file in classpath

    Cannot find the configuration file /oracle/apps/prc/po/....applicationModule/common/bc4j.xcfg in the classpath.
    Hi!
    I'm trying to run the following code:
    String appModule = "oracle.apps.prc.po.manageDocument.uiModel.viewDocument.applicationModule.ViewPurchasingDocumentApplicationModule";
    String cfg = "ViewPurchasingDocumentApplicationModuleLocal";
    ApplicationModule applicationModule = (ApplicationModule)Configuration.createRootApplicationModule(appModule, cfg);
    I get this error message:
    Exception in thread "main" oracle.jbo.ConfigException: JBO-33001: Cannot find the configuration file /oracle/apps/prc/po/manageDocument/uiModel/viewDocument/applicationModule/common/bc4j.xcfg in the classpath
         at oracle.jbo.client.Configuration.loadFromClassPath(Configuration.java:430)
         at oracle.jbo.common.ampool.PoolMgr.createPool(PoolMgr.java:293)
         at oracle.jbo.common.ampool.PoolMgr.findPool(PoolMgr.java:557)
         at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1334)
         at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1312)
         at oracle.apps.prc.po.manageDocument.model.viewPdf.generateXml.getXMLData(generateXml.java:26)
         at oracle.apps.prc.po.manageDocument.model.viewPdf.generateXml.main(generateXml.java:39)
    I have checked and the config file does exist in the correct directory, and I can see it in my Application Module - Configurations. Any idea why this is happening? Am I supposed to configure something specifically for this or add it in my classpath? If so, how am I supposed to do it?
    Thanks
    Mansi
    Edited by: Mansi G on Oct 6, 2008 11:56 AM

    Where is the code you posted? Running in a separate project, I assume? Does that project have a dependency on the project containing the app module specified?
    And just to check (although by default, JDev should do this for you)--the app module project has been compiled since adding the configuration, right? You need to check to make sure the config exists not only under Project/src, but under Project/classes.
    Edited by: Avrom Roy-Faderman on Oct 6, 2008 2:02 PM
    Oh, and BTW--I assume this is not a typical ADF application, right? In a standard ADF application, you would very rarely need to instantiate an application module in code like this; you could just let the data binding facility do it for you. The technique like the one you're using is most appropriate for purely programmatic, no-UI cases. (e.g., once I tried to implement an SMTP server backed by business components. That was an appropriate case for ditching databindings and doing the sort of thing you're doing, because it had no view layer (because it had no UI to render).

  • Where can i find the cached file?

    where can i find the cached file?.
    while one video was getting cached . I could see the cached file in the cache directory that mozilla firefox uses which in my pc is .....Local Settings\Application Data\Mozilla\Firefox\Profiles\uujksq39.default\Cache. but later on when the full video was completely cached i couldnt find the file existing in that directory and i still have my session of that firefox opened and can watch the video from the firefox session.
    since the cached video is still there ,there most be some place where the firefox is storing that file. is it the case that when the file is big (greater than some threshold value) firefox stores in some other directory?

    You can do a search an the about:cache page.

  • Cannot find the object "CrossRef" in Active Directory

    I am trying to install Lync 2013. I'm getting the following error: Error:
    An error
    occurred: "Microsoft.Rtc.Management.Deployment.ActiveDirectoryException" "Cannot
    find the object "CrossRef" in Active Directory."
    WARNING: Enable-CSAdForest failed.
    This error is at "Step 3: Prepare Current Forest" of the install.

    I've tried to run the forest prep as a local domain and I get the following:
    Creating new log file "C:\Users\administrator.xxx\AppData\Local\Temp\2\Enable-CSAdForest-052cfe14-7f42-4969-88da-83279413ab8c.xml".Enable the Active Directory forest to host Lync Server 2013 deployments.
    Prepare Forest Active Directory settings execution failed on an unrecoverable error.Creating new log file "C:\Users\administrator.xxx\AppData\Local\Temp\2\Enable-CSAdForest-[2013_05_30][13_25_56].html".WARNING:
    Enable-CSAdForest failed.WARNING: Detailed results can be found at "C:\Users\administrator.xxx\AppData\Local\Temp\2\Enable-CSAdForest-[2013_05_30][13_25_56].html".Command
    execution failed: Container CN=Microsoft,CN=Program Data,DC=xxx,DC=local not found

  • Cannot find the configuration file bc4j.xcfg

    I have compiled my Business Components Project in JDeveloper and all Projects that reference that BC Project are pointing to the correct classes directory, but I am still getting the following error:
    JBO-33001: Cannot find the configuration file /com/arca/personalinfo/bc/common/bc4j.xcfg in the classpath
    I have re-compiled all my projects in JDev 9.0.3 and have double-checked that the bc4j.xcfg file is in the classes directory.
    Ideas?
    Thanks!
    -Teri Kemple

    This usually is a class path omittion.
    Your Jdev jpr config [double click your jpr]
    - Configurations - Development - Paths
    output path is set to some place
    - Libraries
    - The libraries that are created for you need to have
    the classpath box have your output path set.
    Check your output path, then check all the library definitions
    for your project. There always seems to be more than one
    created for you.
    Good luck curt

  • BUG: JBO-33001: Cannot find the configuration file bc4j.xcfg

    Hi,
    I get the exception JBO-33001: Cannot find the configuration file com\trivadis\adf\demos\login\model\common\bc4j.xcfg in the classpath
    after I have edited the file outside of JDev9052. Why? Because I followed the instructions of the help document "Modifying the JClient Login Dialog for JDBC". To get the JCLoginDialog you have to remove some lines in the bc4j.xcfg file.
    I have deleted the classes directory, rebuild the complete workspace, but I still get the exception.
    Any comments?
    Thanks,
    Markus
    Complete stacktrace:
    oracle.jbo.JboException: JBO-33001: Cannot find the configuration file com\trivadis\adf\demos\login\model\common\bc4j.xcfg in the classpath
         at oracle.jbo.client.Configuration.loadFromClassPath(Configuration.java:369)
         at oracle.jbo.common.ampool.PoolMgr.createPool(PoolMgr.java:272)
         at oracle.jbo.common.ampool.PoolMgr.findPool(PoolMgr.java:473)
         at oracle.adf.model.bc4j.DataControlFactoryImpl.findOrCreateSessionCookie(DataControlFactoryImpl.java:135)
         at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:220)
         at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:97)
         at oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:612)
         at com.trivadis.adf.demos.login.view.FormDeptView1.main(FormDeptView1.java:325)
    ## Detail 0 ##
    oracle.jbo.JboException: JBO-33000: Cannot find the configuration file registerConnectionsFromDocument
         at oracle.jbo.client.Configuration.registerConnectionsFromDocument(Configuration.java:1052)
         at oracle.jbo.client.Configuration.loadFromStream(Configuration.java:264)
         at oracle.jbo.client.Configuration.loadFromClassPath(Configuration.java:352)
         at oracle.jbo.common.ampool.PoolMgr.createPool(PoolMgr.java:272)
         at oracle.jbo.common.ampool.PoolMgr.findPool(PoolMgr.java:473)
         at oracle.adf.model.bc4j.DataControlFactoryImpl.findOrCreateSessionCookie(DataControlFactoryImpl.java:135)
         at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:220)
         at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:97)
         at oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:612)
         at com.trivadis.adf.demos.login.view.FormDeptView1.main(FormDeptView1.java:325)
    ## Detail 0 ##
    java.lang.NullPointerException
         at oracle.jbo.client.Configuration.registerConnectionsFromDocument(Configuration.java:1026)
         at oracle.jbo.client.Configuration.loadFromStream(Configuration.java:264)
         at oracle.jbo.client.Configuration.loadFromClassPath(Configuration.java:352)
         at oracle.jbo.common.ampool.PoolMgr.createPool(PoolMgr.java:272)
         at oracle.jbo.common.ampool.PoolMgr.findPool(PoolMgr.java:473)
         at oracle.adf.model.bc4j.DataControlFactoryImpl.findOrCreateSessionCookie(DataControlFactoryImpl.java:135)
         at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:220)
         at oracle.adf.model.bc4j.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:97)
         at oracle.jbo.uicli.mom.JUMetaObjectManager.loadCpx(JUMetaObjectManager.java:612)
         at com.trivadis.adf.demos.login.view.FormDeptView1.main(FormDeptView1.java:325)

    Repost.
    The original post date was Sep 05 2004, not Aug 17 2001. :-)

  • Who can help? BC4J: Cannot find the configuration file bc4j.xcfg

    Wie kan mij helpen?
    Bij het runnen van een BC4J applicatie treedt de volgende fout op, wanneer gedraaid wordt op de 9ias applicatieserver vanuit de gedeployde ear-file, (draai ik de zaak op mijn lokale OC4J dan gaat de zaak wel goed):
    Er is een fout opgetreden JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-33001: Cannot find the configuration file pilot\common\bc4j.xcfg in the classpath "
    Kijk ik echter in de WEB_INF\classes directory dan bestaat er wel degelijk een pilot\common\bc4j.xcfg file in die directory.
    Het gebeurt bij instantieren van de applicatie-module van BC4J in het volgende code-snippet
    String applicationModule = "pilot.PilotModule"; // Full name of application module
    String configuration = "PilotModuleLocal"; // Name of configuration
    PilotModuleImpl am = (PilotModuleImpl)
    Configuration.createRootApplicationModule(applicationModule,configuration);
    Ik heb Business-components gedecompileerd om te kijken waar de fout optreedt:
    en dit gebeurt in de method loadFromClassPath(String s) in de configuration class
    nadat hij buildConfigurationFileNameFromClassPath de string " pilot\common\bc4j.xcfg "
    heeft opgebouwd. Hij kan de stream dus niet inlezen.
    public void loadFromClassPath(String s)
    throws JboException
    String s1 = "/" + s;
    s1 = s1.replace(File.separatorChar, '/');
    InputStream inputstream = JBOClass.getResourceAsStream(s1);
    if(inputstream == null)
    inputstream = JBOClass.getResourceAsStream(s1.substring(1));
    if(inputstream == null)
    throw new JboException(Class.forName("oracle.jbo.common.CommonMessageBundle"), "33001", new Object[] {
    s1
    try
    loadFromStream(inputstream);
    inputstream.close();
    inputstream = null;
    catch(Exception exception)
    JboException jboexception = new JboException(Class.forName("oracle.jbo.common.CommonMessageBundle"), "33001", new Object[] {
    s
    jboexception.addToDetails(exception);
    throw jboexception;

    I'm having this same problem when I try to run my BC4J project. This has happened to me before but I forgot how it was resolved. Any ideas?

  • Is there any vi or possibility to find the hole dates in an directory and to list the data-pfads as a string?

    is there any vi or possibility to find the hole dates in an directory and to list the data-pfads as a string?
    like in windows a search-funtion?
    I have found one VI, it list the data in the directory self (the pfad from the data as string) but not the data in an under-directory. it also has the funktion to list me the under-directory but it do not list the complite data in every directory
    can somebody help me pleace
    THX

    Hallo Chef,
    unter LV8.21 befindet sich die beschriebene Funktion in der File-Palette:
    Dummerweise gibt es die Funktion in LV8 noch nicht... (Deshalb ist es immer eine gute Idee zu sagen, mit welcher LV-Verson man arbeitet!)
    Du kannst aber unter vi.lib/utility/RecursiveDirList.llb nachschauen, wie es gemacht wird
    Message Edited by GerdW on 08-17-2007 11:17 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    AdvFileFunc.png ‏10 KB

  • Where can I find the Labview file OPENCFG1.V​I

    Does anyone know where I can find the LabVIEW file OPENCFG1.VI?  It would be nice to have a simple text file which list the entire LabVIEW llb directory structure with vi's or a working search function built in.  Maybe I'm not aware of one.  I seen some that browse individual llb's, but not one that does the all llb's.  SS

    I found the problem.  When I tried to convert an llb to vi's in a file labview did not allow OPENCFG1.VI to be converted.  I believe this was created in 7.0 which I do not have.  Could I get someone from NI to please convert the VI for me? Regards, SS
    Attachments:
    OPENCFG1.llb ‏24 KB

  • Find the log files from EIM?

    Please, tell me where I can find the log files from EIM.
    I have already checked the directory /siebel/siebsrvr/log but the files there are old.
    Regards, Slavi

    You need to configure the log level and events for the EIM component.
    You can go to Administration Server Configuration > Servers and choose the EIM Component.
    Good Luck.
    Antonio
    BExpert, Brazil

  • Help! (please :) I have a 1GB iPod that's loaded with music for which my computer can no longer find the original files-due to external mass storage crash during recent move. Is there a way to import iPod music back into my iTunes library on computer???

    Help! (please I have a 1GB iPod that's loaded with music for which my computer can no longer find the original files-due to external mass storage crash during recent move. Is there a way to import iPod music back into my iTunes library on computer???

    Or If there is any purchased music then you can try to transfer purchases
    http://support.apple.com/kb/ht1848
    If you're in the US you can reload purchased music
    http://support.apple.com/kb/ht2519

  • I backup my iphone on my pc and copy backup file into drive D then i setup new OS on my pc. after that i copy the backup file into itunes backup folder but itunes can't find the backup file to restore my iphone. how can i restore my iphone?

    i backup my iphone on my pc and copy backup file into drive D then i setup new OS on my pc. after that i copy the backup file into itunes backup folder but itunes can't find the backup file to restore my iphone. how can i restore my iphone?

    Don't you just love changes in interfaces?
    I found the answer to my question.
    When you attach a device (iPhone, iPad) to your Mac, in iTunes 12 in appears as a tiny icon in the second "row" of the iTunes display. Click the icon and the familiar iTunes display for the device appears. From there, on the Summary screen, you can see the dates of the backups of the device (iCloud and backup to the computer). You can also use the button to backup to the computer.

  • I have downloaded, extracted and installed Elements 12 but it will not open nor can I find the Adobe file in the file where I installed it to..  When I've tried to download and install again

    I have downloaded, extracted and installed Elements 12 but it will not open nor can I find the Adobe file in the file where I installed it to..  When I've tried to download and install again it says that the "Object Already Exists."  It may exists, but it is not visible in the file or in my list of programs on the Startup Menu.

    cactisken
    You should not have to uninstall Premiere Elements 12/12.1 in order to install and run Premiere Elements 13 on the same computer unless your computer is overloaded and the computer resources are compromised. Just use one program at a time.
    Can you still use 12/12.1 on this same computer that will not let you use 13?
    What specific Window operating system are you using?
    Let us go through the usual drill...
    1. Does the problem exist with and without the antivirus and firewall(s) disabled?
    2. Are you using a pen and tablet device instead of a mouse?
    3. Did you install the program with antivirus and firewall(s) disabled?
    4. Disable the SLCache Folder found in Windows 7, 8, or 8.1 64 bit
    Local Disk C
    Program Files (x86)
    Common Files
    Adobe
    and in the Adobe Folder should be the SL Cache Folder that you delete or disable by renaming the Folder
    from SLCache to SLCacheOLD.
    5. Are you running the program as Administrator and is the latest version of QuickTime installed on the same
    computer as Premiere Elements 13?
    Let us start here and then decide what next.
    Thank you.
    ATR

  • My LV program can't find the iak file when the program is loaded from a different PC.

    Hello all,
    My LV vi with Fieldpoint I/O and it's IAK file are stored on the company network.  If I load and run the LV vi from the PC it was developed on, everything is fine.  If I load and run on a different PC (that has an identical install of LV), the LV vi can't find the IAK file (all of the I/O pointers to the file are grayed out.) 
    Also, if I make an EXE out of the vi on the machine that can find the IAK, it won't find it if it's run from the other machine.
    It is not related to whether one machine has different "rights", as they are identical.  It's not related to different installs of LV, as they are identical.   
    I have found that this is related to the network login name/password, and to the machine's network name.  If I login on the second machine and try to run the program, it won't find the IAK.  If I point it to the IAK it will run.  If I save it and log out, and then login as a different user with the same rights on the second machine, it won't find the IAK again, until I re-point it there when I re-run it.  This is true for both the vi and the EXE.
    This problem makes deploying the EXE difficult to different machines, as the first time it's run, the EXE has to be pointed to the IAK.  Pointing the EXE to the IAK is difficult as these installations have no keyboard or mouse.
    Does anyone have any ideas on how to fix this so the LV vi or it's EXE finds the IAK from no matter where it's loaded from?
    Thanks,
    Mike

    Laura,
    I figured I'd continue this thread because it's along he same line..
    I have two Fieldpoint systems. They are identical, except for one thing...one has an AI-110 in position 7...the other has nothing. Both have the same IP address, etc and I swap the ethernet cable between them when I want to select which one I use.  I use a dedicated ethernet card to the FP processor...and it's not the company net.
    There are two IAK files...one for the system with the AI-110, one for the system without the AI-110. The two IAKs are in different paths.
    Before I had the system and the IAK without the AI-110, I made an EXE of the code that woked with the AI-110, and it worked fine.
    But now if I run the EXE after I've used MAX and opened the IAK without the AI-110, the EXE won't read the AI-110!  I have to go back into MAX and open the IAK that has the AI-110 in it, close MAX and restart the EXE for the EXE to see the AI-110.  (Max is NOT SET to "Download Items on Save")
    I looks like the EXE is looking at MAX to get the IAK or a pointer to the IAK.
    Did I build my EXE incorrectly?  Shouldn't an EXE completely ignore MAX once it's made?
    Thanks,
    Mike

Maybe you are looking for

  • "Automatic" Photo Gallery

    Hi everyone! I'm trying to make an "automatic" photo gallery: when you upload the photo in the source folder, it automatically gets uploaded in the gallery. Is there a chance to make this? I have this file that calls Word files, and as I update the s

  • Same SSID different MAC address

    Ok... This is the best place for me to post this I think... I am sharing an internet connection and am relatively close to the router (linksys) but because of the materials my building is constructed with I get a **** poor connection. So, there is a

  • H77MA-G43 BLUE SCREEN in XP Pro

    Today I did build a computer to a customer, I used H77MA-G43 and Intel Core i3 2100 3,1Ghz, 4Gb corsair 1333Mhz memory. When trying to install XP Professional on the new WD Blue-500G-drive I recieve bluescreen of death before the installation starts

  • Idoc error caused by warning message

    Hi guys, I am using GLMAST idoc message for G/L account creation. Before the G/L account is saved, system shows warning message. Because of this warning message the inbound GLMAST idoc finishes with error (status 51). Is there any way how to solve th

  • Problem in copy expresssion in 11g PS1

    i Hve used a copy expression inside the email body.It works fine in 11g R1 but it gives the below error in 11gps1 http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure Fault lbpelFault><faultType> <message>0</message></faultType><s