File modification date (lastModified())

Hi, would like to get the last modification date of a file.
I'm using lastModified() from class File, but it always gives
me back the actual date.....I don't understand where's the problem.
the code is:
file = new File(excelPath);
Date fecha = new Date(file.lastModified());
Thanks.

file = new File(excelPath);
Date fecha = new Date(file.lastModified());Are you sure that the file exists? Otherwise, you'd probably see the creation time, which is, guess what, now.

Similar Messages

  • DNG file modification date not changed by writing metadata?

    I use LR 2.7 on Windows XP.   To my surprise, I just noticed that writing metadata updates (e.g., new keywords) from LR to the DNG files does NOT appear to update the file modification date, which suggests obvious issues for backup strategies (yes, I understand that a changed modification date introduces other backup issues).   I have verfifed that the metatdata does indeed change in the DNG files, so I am mystified.   Can someone shed some light on this?   Thanks.
    js
    www.johnshorephoto.com

    Yes, I explicitely invoke "save metadata to file".   Furthemore, I have checked the behavior by (a) modifying DNGs in LR; (b) saving the metatdata to the DNG; (c) creating a new LR catalog and importing the revised DNGs.    The metadata changes do show up in the re-imported DNGs (and the metadata field "Metadata Date" correctly shows the recent change).  Morevover, the file sizes do change (wth the metadata changes) even though the modification dates shown in windows explorer do not change.
    However, I just redid the experiment to double check, and discovered an important clue - the mysterious behavior occurs when the DNG files are on a NAS device (in particular a Netgear ReadyNAS Duo.   To summarize:
         - When the DNG files are on a local hard drive, the file modification dates change as expected
         - When the DNG files are non local (i.e., on the network but on a NAS device), the file modification dates do not change even though the file sizes do change;
    What's more, I see the same behavior when accessing the DNGs via Adobe Bridge (CS5) - i.e., if I change the metadata, I'm asked if I want to apply the metadata changes to the DNG, and I say yes (and confirm by looking via Bridge at a copy of the changed file).   On a local disk, the file modificaiton dates change (as do the modification date displayed in Bridge), but if the files are on the NAS, the modification dates do not.
    Any additional thoughts?
    js

  • File Modification Date problems

    We are running Appleshare 10.4.11 on an Xserve box. We have a problem in that every time a word document is opened, the modification date is updated on the file. When we ran Appleshare 10.2.x this did not happen and it enabled us to see at a glance how old a file really is.
    I am not sure where to start in troubleshooting this issue. Any help will be greatly appreciated.
    Sincerely,
    Rusty

    file = new File(excelPath);
    Date fecha = new Date(file.lastModified());Are you sure that the file exists? Otherwise, you'd probably see the creation time, which is, guess what, now.

  • What would change a file modification date into the future?

    Of late, I've been noticing that [apparantly random] files that have NOT be accessed are showing a modification date somewhere in the future.
    I couldn't figure out why zip was adding files I hadn't touched to an archive of files changed since a certain date.  Looked in Finder, and they have dates from 1 to 20 some years into the future, in the modification column, and sometimes, no creation date.
    Also, files deep in the contents of some apps are losing me as an owner, leading zip to tell me "access denied".
    Any thoughts as to what's going on?  Other than the paranoid; there's some evil virus, whatever, running amok.

    Did you check the code in your template.dwt file for errors?
    http://validator.w3.org/
    Did you save over or rename your original Template.dwt file?
    Did you move your Template.dwt file from it's Templates folder?
    Nancy O.

  • How to capture file modification date and time over the web

    HI!
    I am creating a web based application and I am using webutil package for al lot of my work being that I ma working with renamin,deleting and uploading files for a users machine to the database. There is one functionality thing that I have to do in this application that webutil does not take care of and that is capturing the modification date and time from a file on the users machine. Please help me capture the date and time of a file on the users machine.
    Thanks!

    Since webutil allows you to write file on client PC directory, then you first create a directive file, then host that directive file. the directive file content is just the command lines when you manually do it on PC.
    Refer the ideas--just the ideas not the same built-ins in this URL:
    Hyperlink in forms

  • Run Batch OCR Without Changing File Modification Date

    I'm running Acrobat X Pro (as part of CS6) and would like to batch OCR all of the PDFs on my PC (probably over 1,000 files) without changing the "modify" date of the files (otherwise they will all change to the date of the OCR, which will make it more difficult to find files when sorting by date because they'll all come up as the same date).  Is there a way to do this?
    If I've posted this in the wrong place, please tell me where to post it.
    Thanks!

    No. The modification date is a system function and requires access to the file info in the file directory to change, not something that programs normally do. There are programs that allow changing the dates, or used to be anyway. All I know to do is to create a text file with a directory of the PDF files, then go back and change the dates back to those dates. It has been a while since I have played with file dates, but it might be able to be automated (though probably with a fair amount of programming skill).

  • File Modifications Date as Future date

    Hi Guys ,
    I am creating Installer from PackageMaker for java Application. Windows Installer is done. "LOCALES.jar " file holding future date in 2040 .You can see it from the screen shot. But same file when i transfer to mac it doesnt stay that date. is there any way assign the future date for perticuler file. I tried to change the computer date and do the modifications . But seems like it does not correct way. in windows the developer changed the computer date and it holding the that date in future "2040".
    Thanks in Advance
    Lakshan

    Seen these?
    Applet Caching problem (Applets forum at JavaRanch)
    Java Applet not caching - Stack Overflow

  • FileUpload resource file modification date

    Hello
    I need to use an uploadfile box to select and send a file to a RFC.  This is already done with the code shown above.
    The question is how to get the modification or cration date of th file. 
    Here is my code, and I can only get the resource name and resource type.
         IPrivateUploadFileVIEW.IContextElement element = wdContext.currentContextElement();
         //     if a file in the FileUpload field exists
         if (element.getResource() != null)
              IWDResource resource = element.getResource();
              try
                   InputStream archivo = resource.read(false);
                   byte[] b = new byte[5000];
                   archivo.read(b);
                   //ResourceBundle.getBundle();
                   wdContext.currentZ_Lmmfu_Cambio_Estado_InputElement().setI_Archivo(b);
                   wdThis.wdGetAdministracionCMPController().executeZ_Lmmfu_Cambio_Estado_Input();
                   //Imprimir nombre del archivo     
                   String name=resource.getResourceName();
                   wdComponentAPI.getMessageManager().reportException(name,false);
                        File f = new File(resource.toString());
         catch(IOException error)
              wdComponentAPI.getMessageManager().reportException(error.toString(),false);
          //report success message
         // wdComponentAPI.getMessageManager().reportMessage(IMessageAdministracionCMP aa ,new Object[] { resource.getResourceName()}, false);
          else
         // if no file in the FileUpload field exists
         //     report error message
         wdComponentAPI.getMessageManager().reportException("Choose a file",false);
         //     clear the 'FileResource' context value attribute
         element.setResource(null);
    //     wdThis.wdFirePlugFromCambioMasivoToActualizacion();
        //@@end
    //End of code
    Thanks in advanced

    Hello.
    Thank's for your replies, and happy new year.
    The first answer is not posible to implement, because I don't create the files name, but it would be a nice way to do the job.
    The second method I think is the one I need, but  how do I do to choosing the file? I am using use FileUpload for sending the binary file, and don´t know how to access the file and path use them por file properties, because the path WebDynpro Gives starts like ..//../computersname/..... .
    Is there another file browser I can use for coosing files? or how do I use FileUpload for using file properties?
    Thanks for your answers.

  • Bad file modification dates

    I was wondering if this is a known issue, I haven't been able to find any mention of it. I have a 3rd generation iPod Touch running ios 4.1. I have two apps, Filer and PlainText, that allow me to drag files back and forth between the iPod and my Mac (using iTunes, of course). When I drag a file from the Mac to either app, the file date changes (to something in 1972), even though on my Mac the dates remain correct. The iPod's system date and time are correct. Any ideas?
    Thanks

    I finally got an AppleCare/Powerbook specialist to set things up so I can connect via ethernet. I don't remember all the steps but they included my (setting up a new location on the G4 and) putting in some manual IP addresses for each computer. It works like a charm now. I just change locations and click on the alias of the G3 on my desktop. (That had stopped working awhile back...)
    Too bad I got bad info the first time around and that it isn't easier to do this yourself. It should be a cinch, Mac to Mac.
    Cheers,
    John L

  • Wrong file modification times through api?

    Hello guys,
    it seems to me that the CS5 server has a problem with the file modification date. The first time I saw this was when I tried to get the modification time of the current document opened on the server through app.documents[0].filePath.modified. It always returned the wrong time and I was not able to fix this, so I let the feature down. Now I think I found another situation where this "bug" seems to take place.
    - Export a story into incopy format (icml)
    - change the local icml-file
    - update the link on the server, everything ok
    - another change on the local file
    - update the link, and now, the content is not updated
    - save document
    - restart server
    - open document again
    - update link, and the content is updated correctly
    Maybe this two problems are connected but I can not say this for sure. I hope a developer can take a look at this.
    Thanks

    Hi
    This class uses XML?. Because it may be a problem with the MSXML Parser version. What version do you have?
    In this link <b><a href="http://support.microsoft.com/kb/269238">MSXML Parser Versions</a></b> you can check the latest versions.
    I hope its helps,
    Greetings

  • Zoom H2n "file created" dates are WRONG

    Zoom H2n (audio files) "file created" dates are 31 December 1969 @1900 unless I DL them to Win7 box and import them.  The time and date is set correctly in the H2n.  The time and date are correct for creation in Win7. It makes the EVENTS fall into December 1969 category in FCP X and I don't seem to be able to change them. Nothing about this is mentioned on the Zoom website.

    I know this is a rather old post but this bug is still unfixed so maybe it may help someone.
    This is actually a Zoom H2n bug, not a Final Cut one. The problem is that the Zoom sets the file creation dates to 1 january 1970 00:00. However it sets the right file modification date. A quick and dirty workaround I found for this is to use the terminal to fix it:
    find /Volumes/H2N_SD -name "*.WAV" -exec fix_zoom_dates.sh "{}" \;
    With fix_zoom_dates.sh being a shell script somewhere in your $PATH, containing the following:
    #!/bin/bash
    SetFile -d "$(GetFileInfo -m $1)" $1
    What it does is scanning the whole H2n sd card and setting the file creation date to the file modification date, for every WAV file present. You have to do that every time you want to import something from the Zoom, before opening Final Cut.
    Hope this can be helpful.
    Yo

  • Just opening InDesign file changes "Date Modified" date?

    Hi,
    Running InDesign CC w/ Mac 10.9.5 and if the file has say yesterdays date listed as the "Date Modified" in the file listing.
    If I just want to open the file just to take a quick look at the file without making any changes the "Date Modified" automatically changes to the exact time/date as opening the file.
    Why? I need the "Date Modified" to stay correct. 

    I've tried this experiment with InDesign 10 (CC2014) on my MacOS 10.9.5 system and do not see any changes to the OS modification date for the file. Same is true under Windows. And I tried doing some suspicious operations to the document such as printing and PDF export. Closed the document and checked the File Information. The Modification Date did not change. And it normally would not change unless you explicitly save the file. Anything else you are doing while reviewing the document? Again, we would like to help, but can't repeat your symptoms.
    BTW, an experiment to try is to “lock” the file using the MacOS Get Info dialog and then repeat your experiment. When opening the document in InDesign, you will see the window labeled as “read-only.” What happens when you subsequently close the document and look at the file modification date?
    And of course, I assume you are not confusing the file modification date with the “last opened” timestamp!
                 - Dov

  • Changing creation or modification date with Automator

    Three computers access iTunes in my apartment. The files are located on a drive connect to an airport extreme base station. Each computer needs to import music and have physical access to it for iPods and playlist creation. Since iTunes does not automatically check for new files I am in the process of building an Automator script to fix the problem.
    I have created an Automator action that allows the user to control-click a folder with audio files in it and have Automator manually change the file name, then import the files into iTunes. My hope was that this would change each files modification date so that, at a later time, another Automator action could search the network drive for newly added media via the modification date. My problem is that simply changing the name does not change the modification date. Even creating an archive and unzipping it before importing does not change the date.
    What action can I do with Automator that will change the modification date on those files so that I can search for them later? I know I can add the date to the file name but I don't want a user to have to guess which dates files were added (i.e. I'd have to tell Automator "look for this specific date in the file name' which is obviously unhelpful if I don't know the specific date).
    Long story short, how can I change either dates with Automator?

    Create a column with the following.
    TIMESTAMPDIFF( SQL_TSI_day, Opportunity."Created Date" , CURRENT_TIMESTAMP )
    add a filter on this column, for example, <=90.
    the SQL_TSI_month does not return accurate number of months.
    Cheers!
    Shilei

  • File window not updating modif. dates – and mysterious parallel universe discovered

    The day started innocently enough when I tried to edit some <meta> content on a site I'm building and then saved my work. Little did I know...
    DW's "File" window refused to update the "Modified" column of the files I worked on.  Open and closing the files shows that my changes have been recognized and incorporated into the HTML, and the files show up with correct modification dates in Finder (I'm on a Mac). They just won't change date in DW.
    When I upload the modified-but-not-redated-in-DreamWeaver files to my remote site, they appear with the incorrect dates on the server, but a text comparison in DW shows that my local and remote files are synched.
    Now for the truly weird part: when I run the site in Safari (after flushing its cache), a Source check shows the old code is still operational.  (I also changed the titles of the pages in question to quickly confirm which version was being displayed. This check shows the old title displayed.)
    Here's the site address:  http://www.bearriverbooks.com/index.html
    Now for the truly, truly wierd part.  I have a parallel site ( http://www.queen-of-the-northern-mines.com/index.html ) which contains copies of the bearriverbooks.com files. These files, too, show the wrong modification dates in DW's "Files" window and on the remote server – but they display correctly. Anyone who wants to check can compare page titles, which are longer in the later pages with correct code.
    I checked the remote site addresses in the "Manage Sites..." center.  I have not crossed my wires there (though I can smell a few arcing badly in my brain.).
    The players:  2.8 GHz Intel Core i5 27" iMac running Mac OSX 10.6.7  /  Dreamweaver CS5 v.11.0 Build 4964
    Thanks in advance,
    Richard Hurley
    Grass Valley MultiMedia

    I am having the same issue on a Mac 3.4Ghz i7 running Mac OS 10.7.  I have Dreamweaver CS 5.5 v.11.5 Build 5344.
    I have a linux webserver, running ProFTPD v.1.3.1
    Both my mac and my linux server are set to the correct date and time.
    And ls on the linux servers tells me the files have the correct modified date and time, but this is getting lost in translation to dreamweaver when I view the remove server in the File tab.
    Any help appreciated.

  • Can I populate a text field in one PDF with the modification date of a different file ?

    Rather convoluted problem here but I'm trying to place a text field on a PDF document that serves as the main menu page for a library of interlinked PDF documents
    The complete library contains over 7,000 files and additions are added and documents changed almost daily.
    We currently use batch files to open the main menu from it's shortcut and this runs a check on a sync log file (.txt) to ascertain when the last time the user synchronised with the server to get the latest copy of the files.
    Between a certain time range they are told how long it has been since they sync'ed and are offered the option to sync before opening, after a prescribed timeframe they cannot enter without synchronising. We use Allways Sync to conduct the file synchronisation with our mother files on our server.
    What I'd like to do is take advantage of Allways Syncs automatic synchronisation options to synchronise on log on and at prescribed idle periods there after.
    This works fine but I'd like the text field on the main menu PDF to say when the last synchronisation took place - easy if the main menu is the last file modified .. just use info.modDate.
    However, the main menu is rarely modified therefore I wish to import the text to populate the text field from a different file.. either by interrogating the other files modifictaion data (though I doubt Acrobat can do this) or by simply importing some text stored in another file (a .txt file?) which has previously been created by batch file commands.
    Any assistance would be greatly appreciated.
    Regards,
    Nifty Styles
    (Norfolk, England)
    P.S.  I'm using Acrobat 8.3.1. Professional on Windows XP (SP3).

    Thank you for all your help above.
    Just to confirm your advice, am I right with the following conclusions? :
    1. The script (function) to fill the text field with the modification date of a different PDF file needs to be stored in a folder level .js file.
    2. The document containing the text field needs to call the .js function either within the document script or within the custom script property of the text field itself.
    Further to that can you just advise on the syntax for accessing the modification date of the other document.
    Do I need to assign a variable to the address of the file to be used, and then use this variable in the text form filling script (as below) or can I use a direct file reference at the .modDate command.
    var LastSync = "C:\sync\bin\lastsync.pdf";
    var strMsg = util.printd("h:MM tt",LastSync.modDate) + " on ";
    strMsg += util.printd("dddd, d mmmm, yyyy",LastSync.modDate);
    this.getField("LastSyncDate").value = strMsg;
    If the syntax is totally different to the above I would be very grateful for some guidance in the right direction.
    I much appreciate your time to help me ... I'm almost there.
    Kind Regards,
    Nifty

Maybe you are looking for