Detecting when a file is accessed

Hello all! This is my first time on these forums, so please be kind. And let me know if there is a better place to post this question or a better way to find the answer, because I know you all are being very kind by answering Q's here, and I wouldn't want to waste anybody's time. Oh yeah, and my Java is reeeally rusty. But time to change that, eh? Anyway, on to my question:
Is there a way to find out when a file is accessed? For example, in Windows, you can look at the 'properties' of a file, and it will tell you the last time it was accessed. Is there a Java method that will give me this information (but preferably on any platform, like Linux)?
It doesn't have to be exactly like the Windows "last accessed" information. Really, all I need to be able to do is detect, in real time, when a file is accessed.
I wasn't quite sure where to look for this. Like I said, my Java is rusty (and I'm a total beginner anyway), but I know I never encountered this sort of thing before. So if you just give me a little nudge in the right direction, I'd really appreciate it. Thanks!

Ha! I told you I was rusty... the answer was pretty darn obvious. Obvious enough for a loon like me to find on my own! Looks like this method is the one I would need:
Java.IO.File.LastModified()
http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#lastModified()
Ugh, shoulda searched more before posting, sorry. But on a related Q, what would be the best way to wait until this is changed?

Similar Messages

  • Detect when play audio is done.

    Hi,
    I use this javascript function to play my embed sound file:
    function PlaySound(soundSrc) {
    var thisSound;
    if((!document.all)&&(document.getElementById)){
    thisSound = eval("document." + soundSrc);
    thisSound.Play();
    else if(document.all){
    thisSound = eval("document.all."+ soundSrc + ".src");
    document.all.sound.src= thisSound;
    else
    return;
    It works good. Now I need to do something right after sound file is done playing. Can somebody tell me how to detect when sound file is done playing?
    Thank you,

    Hi,
    a Google search doesn't bring up an event being reaised on stop. So I guess a timer is what you should consider using.
    Frank

  • Is there a way to play an mp4 file at the beginning of a published project only when the project is accessed from a specific site?

    Is there a way to play an mp4 file at the beginning of a published project only when the project is accessed from a specific site?
    A little background info. I use Captivate 7 and currently have over 100 projects that I maintain on a quarterly basis. I publish using the SWF format and upload the swf/htm files to a server where they are then accessed from a few locations (within our online documentation, in our software product, on two different websites). Many of the projects are linked so some will be viewed as a series and others viewed as a standalone video. Each video uses the same template and includes an intro and end slide. Now my organization wants to implement a new intro to all videos (those I publish and those from several groups across the organization). My current intros provide overview material for the specific video so the new intro, which is an animation with audio in mp4 format, would need to be placed at the start of each project. The issue is, the intro adds 9 seconds to every video and in many cases doesn’t add any value (say, if a user accesses the video from within our product or views the videos as a series). I’ve talked it over with my boss and we want to try to add the intro only to videos accessed from site X, not any other location. So now to my question. Is there a way to play an external mp4 file (intro) only when the published project is accessed from a specific site, therefore eliminating the need to update each project? Maybe there's a way to add a parameter or variable to the URL or the html code?
    Thanks in advance for your suggestions. Please let me know if you need additional information.

    AimeeLove,
    I have a solution for you.  You may have to modify the code a little bit based on how long the timeline animation is for your clock.  I based mine on 3 seconds to complete a minute hand sweep around the clock.
    Milliseconds for each point on the clock:
    12 = 0
    1 = 250
    2 = 500
    3 = 750
    4 = 1000
    5 = 1250
    6 = 1500
    7 = 1750
    8 = 2000
    9 = 2250
    10 = 2500
    11 = 2750
    In the mouseover section for 12 o' clock, put this code...
    myVar = setInterval(function(){
         var pos = sym.getPosition();
         if (pos > 0 && pos < 50){
              sym.stop(0);
              clearInterval(myVar);
    },10);
    When you point to the time, the setInterval method loops every 100th of a second and checks the current position of the timeline.  When the timeline reaches the range between 0 and 50 milliseconds (almost impossible to hit 1 specific point), the timeline will stop at 0.  Also, the clearInterval will be fired to stop the loop.
    In the mouseout section, put this...
    sym.play();
    clearInterval(myVar);
    It start the clock again, and it also clears the loop in case you mouseout before you reach the range.
    Make sure that myVar is a global variable so you can clear it from the mouseout section.
    Repeat this for each point on the clock.  To avoid potential conflicts, you may want to use my12, my1, my2, etc. instead of myVar.  I put the milliseconds at the top that you would use as the beginning of the range.  50 milliseconds should be enough to catch it.  So, for 5 o' clock, you would make your range between 1250 and 1300.
    Let me know if you have any questions.  Thanks!
    Fred

  • My iPod says "cannot be synced. The required file cannot be found. Always when half way through a sync. It also shows apple logo when I try to access photos and I think the issues are linked. Any ideas?

    My iPod says "cannot be synced. The required file cannot be found" it also defaults to apple logo when I try to access photos. I think the issues are linked. Any ides?

    So you have tried removing/trashing your iPod's photo cache? See here for more information on where to find this file.
    iTunes: Understanding the iPod Photo Cache folder
    B-rock

  • Just bought an ipod touch and it wont sync with itunes. Tried resetting sync history but doesnt work, plus when i try to access itunes preferences it freezes for ages and creates loads of distnoted.exe files?????

    Just bought an ipod touch and it wont sync with itunes. Tried resetting sync history but doesnt work, plus when i try to access itunes preferences it freezes for ages and creates loads of distnoted.exe files?????

    Just realised when reading other peoples problems that it is not actually letting me reset sync history???

  • I cant seem to open some photos on Iphoto. I downloaded like 3 months ago from my phone into the iphoto. I could access ALL of my photos back then but when I try and access them now I cant seem to open the file

    I cant seem to open some photos on Iphoto. I downloaded like 3 months ago from my phone into the iphoto. I could access ALL of my photos back then but when I try and access them now I cant seem to open the file. When i open iphoto and open the folder thats on it, i can see ALL the photos that are there but when I click on different ones some appear in the larger screen but A LOT of them dont appear. Iphoto seems to have erased the file or I dont know.
    Also I tried clicking on the photo that doesnt appear and making it "Reveal it on finder" - "original file" and it says 'The operation can’t be completed because the item can’t be found.".
    I really want those photos because they involve a really special family vacation, please help me find those photos

    A LOT of them dont appear.
    What do you see in the window when you click on those?  A blank, black window?  An exclamation mark?  What?

  • After having upgraded my MacBook to Snow Leopard, the following error message pops when I try to access iTunes: "The file iTunes Library.itl cannot be read because it was created by a new version of iTunes".  I cannot now access iTunes.  How can I resolve

    After having upgraded my MacBook to Snow Leopard, the following error message pops when I try to access iTunes: "The file iTunes Library.itl cannot be read because it was created by a new version of iTunes".  So, now after the upgrade, I cannot access iTunes.  How do I resolve this??
    Thanks

    zepel has it, but perhaps some more detail will help.
    Empty/corrupt library after upgrade/crash
    Hopefully it's not been too long since you last upgraded iTunes, in fact if you get an empty/incomplete library immediately after upgrading then with the following steps you shouldn't lose a thing or need to do any further housekeeping. In the Previous iTunes Libraries folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library.itl as iTunes Library (Corrupt).itl and then rename the restored file as iTunes Library.itl. Start iTunes. Should all be good, bar any recent additions to or deletions from your library.
    See iTunes Folder Watch for a tool to catch up with any changes since the backup file was created.
    When you get it all working make a backup!
    tt2

  • When I try to access iTunes I get 'The file "iTunes Library.itl" cannot be read because it was created by a newer version of iTunes.' But when I try to download iTunes I get error (-42408)...help please.

    When I try to access iTunes I get 'The file "iTunes Library.itl" cannot be read because it was created by a newer version of iTunes. Would you like to download iTunes now?'' But when I try to down load I get "unknown error occurred (-42408)". Don't know what to do next and I can't get into my iTunes library. (I have an iMac, OS10.6.8.)

    Did you uninstall iTunes 11 and replace it with iTunes 10.7? If so, you'll need to go through a few steps to put things right:
    Rename "iTunes Library.itl" to some other name;
    Copy newst ITL file from the "Previous iTunes Libraries" folder into your main iTunes folder and rename it to "iTunes Library.itl";
    Download iTunes 10.7: http://appldnld.apple.com/iTunes10/041-7195.20120912.d3uzQ/iTunes10.7.dmg
    Download/install shareware app called Pacifist;
    Open Pacifist and, separately, mount iTunes DMG file -- drag iTunes PKG file into Pacifist and install iTunes via the Pacifist application -- be sure to answer yes to replacing everything Pacifist asks about;
    Enjoy iTunes 10.7.
    Cheers,
    trane

  • When in Windows 7 (using bootcamp obviously) I am able to see my files in my Mac partition. When I try to access them I am told that I need permission from the administrator. How do I give myself permission to access files between the two partitions?

    When in Windows 7 (while using bootcamp) I am able to see my personal files in my Mac partition. When I try to access them I am denied access, it tells me that I need permission from the administrator. How do I give myself permission to access files between the two partitions, Mac/Windows7?

    When in Windows 7 (while using bootcamp) I am able to see my personal files in my Mac partition. When I try to access them I am denied access, it tells me that I need permission from the administrator. How do I give myself permission to access files between the two partitions, Mac/Windows7?

  • Adobe Bridge shuts down when I try to access files on my external drive. Have been using the drive for months with no problems.

    Adobe Bridge shuts down when I try to access files on my external drive. Have been using the drive for several months with no problems.

    Due to the current unavailability of clairvoyants and mind-readers in the forum, we respectfully request you supply sensible, complete details.
    A lot more information about your hardware and software is needed.
    BOILERPLATE TEXT:
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CC", but something like CC2014.v.2.2) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    a screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Have been here before but still have not resolved a fix for a black screen when I try to access a PDF file...Now I've got a new iPad and need the User Guide which is only available inPDF

    Have been here before but still have not resolved a fix for a black screen when I try to access a PDF file using Safari...Now I've got a new iPad and need the User Guide which is only available in PDF and FireFox will not work.

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * On Windows you can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac you can open Firefox 4.0+ in Safe Mode by holding the '''option''' key while starting Firefox.
    * On Linux you can open Firefox 4.0+ in Safe Mode by quitting Firefox and then going to your Terminal and running: firefox -safe-mode (you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    [[Image:FirefoxSafeMode|width=520]]
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • Can lightroom 3 complete 1:1 previews when unreadable files are detected

    when lightroom 2.6 detects an unreadable file, be it a .mov or a corrupt file, it stops the process of creating 1:1 previews until I answer the dialogue box that pops up after the import and before the previews are built. Can it please allow the process of building previews to continue, while sequestering the questionable file, moving them to a folder to be dealt with later. Can't this be some kind of checkbox in the import dialogue or a simplified feature that is automatic? My understanding is that you are now thinking of simplifying the import dialogue box for the less informed, while I'm hoping it can still provide us with more detailed options to speed up our work. When I build a catalogue of 2500 to 3000 images that I just shot on deadline, and want to ingest that material overnight and get back to my edit in the morning, this little glitch makes life IMPOSSIBLY SLOW.
    see my story below:
    I was just importing last night's job of 2500 images shot during a theater production into lightroom 2.6 - 64 bit on my 8 core Mac pro tower running 16 Gigs of RAM. As I often do after such a production - I return to the studio - move all the files from the cards into a single folder on my desktop then import them all into lightroom creating copies of the RAW files and the catalogue itself onto redundant hard drives. I also always create 1:1 previews for quick and easy viewing at any point in time. It's usually late in the evening, and I set Lightroom about this task while I go home to sleep, then begin my edit in the morning with catalogue built and previews made.
    HOWEVER-- after the catalogue was imported but BEFORE lightroom began making previews, lightroom posted a dialogue box on my screen advising me that a file was somehow unreadable -- either corrupt, or the wrong kind of file, COMPLETELY STOPPING THE TASK OF BUILDING THE PREVIEWS.
    So I returned in the morning, no previews were made -- and two hours later I'm not even 1/2 way through building the previews. SO-- ADOBE people -- or any lightroom users out there -- is there any way for Lightroom to continue building previews instead of waiting for me to respond to this dialogue box first. Lightroom assumes apparently that I at my computer to respond to this dialogue box.
    It seems like such a horrible waste of my time when I'm under deadlines to get this work done. I'm happy for the reminder that one of my files was a movie file or a corrupt file or whatever -- please lightroom... sequester these file on my desktop somewhere and finish the job!
    Does anybody know if there is a preference I can click on or off to prevent this from happening. Trying to edit large files that are 10- 21 megapixels and waiting for 1:1 previews to open takes a long time of and by itself -- but waiting and extra 4 hours to have previews built that should have been made while was asleep is something that should NOT be happening. I'm about to make two changes that should speed up my workflow i.e: install a fast ATI Radeon HD 4870 with 512MB of RAM, plus upgrade to snow leopard to take better advantage of the 8 cores of processors that my machine has. But even these upgrades would be for nought when Lightroom STOPS the process in it's tracks.
    HELP-- SOMEONE -- PLEASE!!!
    owen carey

    No one's harmed as we all know this since forever.
    It is wel documented on the forum.
    By not saving it with the pdf option check reduces the size a great deal many users use it to save master files and then do a save as with the option turned on when they place it in another application.
    In case you are not familiar with this option turned off and printed to a postscript printer the file will print properly even if it does not display the right way.
    At least that is my understanding.

  • I purchased a new MacBook Pro and when transferring files iphoto did not transfer.  I have a question mark in the place of the icon.  My pictures are in library but can't properly access iphoto.  Thank you

    I purchased a new MacBook Pro and when transferring files iphoto did not transfer.  I have a question mark in the place of the icon.  My pictures are in library but can't properly access iphoto.  Thank you

    Sure-glad to help you. You will not lose any data by changing synching to MacBook Pro from imac. You have set up Time Machine, right? that's how you'd do your backup, so I was told, and how I do my backup on my mac.  You should be able to set a password for it. Save it.  Your stuff should be saved there. So if you want to make your MacBook Pro your primary computer,  I suppose,  back up your stuff with Time machine, turn off Time machine on the iMac, turn it on on the new MacBook Pro, select the hard drive in your Time Capsule, enter your password, and do a backup from there. It might work, and it might take a while, but it should go. As for clogging the hard drive, I can't say. Depends how much stuff you have, and the hard drive's capacity.  As for moving syncing from your iMac to your macbook pro, should be the same. Your phone uses iTunes to sync and so that data should be in the cloud. You can move your iTunes Library to your new Macbook pro
    you should be able to sync your phone on your new MacBook Pro. Don't know if you can move the older backups yet-maybe try someone else, anyways,
    This handy article from Apple explains how
    How to move your iTunes library to a new computer - Apple Support''
    don't forget to de-authorize your iMac if you don't want to play purchased stuff there
    and re-authorize your new macBook Pro
    time machine is an application, and should be found in the Applications folder. it is built in to OS X, so there is nothing else to buy. double click on it, get it going, choose the Hard drive in your Time capsule/Airport as your backup Time Machine  and go for it.  You should see a circle with an arrow on the top right hand of your screen (the Desktop), next to the bluetooth icon, and just after the wifi and eject key (looks sorta like a clock face). This will do automatic backups  of your stuff.

  • Message saying a virus was detected when opening pdf files

    I can't open any pdf files any longer. A message appears saying a virus was detected and the file was deleted.  I uninstalled all adobe programs and now
    I can't re-install any of them, the same message appears when I try.

    Your antivirus is giving "False positives". NO Adobe products (legitimate Adobe products from this site) contain viruses.
    Also, it's nearly impossible to embed an actual virus in a PDF. Links to virus downloads? Yes, but the executable files themselves? No.
    Disable your antivirus. (It may be time to consider a different A/V software too. AVG is about the best in the industry when it comes to updating definitions, which prevents "false positives".)
    Download the full Adobe Reader installer here: http://get.adobe.com/reader/enterprise/

  • Access Denied when saving file - CS5 & Win7

    Using Dreamweaver CS5 and Win7...  Sporatically, I will try to save my .html file and will get an error saying "access denied" to the .tmp file.  So I do a "Save As" to another file name and then the original file literally disappears (is deleted / erased) from my hard drive.  No where to be found!
    Has anyone else had this experience?  Is there a work around?
    Godspeed,
    Omar

    Here's the solution (as I learned from other forum posts):
    - Disable the Preview Pane in Windows 7...
    or
    - Simply "deselect" the file in Windows Explorer (thus deactivating the "Preview" of the file) and try to save it again.  The "Save As" dialog will appear and you can save it with the same name.
    What is actually happening:
    When a file is selected in Windows Explorer and the Preview Pane is enabled, Windows 7 displays the file (and locks it).  If the file is also open in Dreamweaver and any modifications are made, the file is considered a temp (.tmp) file by Windows as it is already in use by the Preview Pane (and locked).  When you try to save the modified file in Dreamweaver, you get the "Access Denied" error.  If you go into Windows Explorer and deselect the file, the file will disappear (be deleted / removed) as Windows now considers it a "temp" file that is no longer being previewed. At this time (assuming you didn't close the file in Dreamweaver) you can try to save it again and a "Save As" dialog will open (since the original file was deleted).
    Hope this helps!
    Godspeed,
    Omar

Maybe you are looking for

  • Error message when downloading new itunes

    I get an error message when trying to download the new version of iTunes. It says I need to contact my systems administrator because I dont have authorisation. I have already uninstalled itunes and deleted it from my programmes but neither of these h

  • Problems Installing trial Lightroom on laptop w/Vista

    Hello, I just purchased a new laptop and I downloaded the trial version of Lightroom.  I saved the exe file to my desktop.  I am now attempting to extract it.  I am trying to extract to c:Program Files, but receive the following message: " A problem

  • Workbook size in BI 7.0

    Does anyone have any information with regrads to the size of a BI 7.0 workbook in comparison to 3.x.  We are presently converting to BI 7.0 and are noticing a consistent increase of 300% (tripling) in size.  This seems to be true regardless of initia

  • Java Applets not working in New Versions of Java

    I have developed a chat program using Applets(developed using jdk1.2),using a Server.Everything is perfectly working.Now,On my client machine i installed jdk1.4, and when i try to download the same applet it is giving Applet ClassNotFound Exception?.

  • How to get my photostream pictures onto computer in windows

    I have an Iphone 5s, and am going on a trip and need to get all my photos off my phone so I have more room. I have a windows computer, and am trying to get my photostream photos from my phone onto my computer and got some yesterday but not all becaus