Home arrow static arrow Java Programming [Archive] - Track File Usage in Java
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Track File Usage in Java
This topic has 23 replies on 2 pages.    « Previous | 1 | 2 |

Posts:14,142
Registered: 99-04-02
Re: Track File Usage in Java  
Aug 3, 2004 11:51 AM (reply 15 of 23)



 
on a related topic, ... how does Windows Add/Remove Programs control panel keep track of it... it has a thing that tells you if an app is used often or rarely or whatever... is that just gauging it by the last accessed time of the executable, or is there something in the OS actively tracking these things.
 

Posts:19
Registered: 8/3/04
Re: Track File Usage in Java  
Aug 3, 2004 11:56 AM (reply 16 of 23)



 
Ditto with some of the other users here. We had a problem with over-redundant data on our network, and wanted to track how often something was accessed. Unless your download manager has some Windows process that accesses it in the background, isn't just checking the timestamp on the file adequate? Maybe you already answered this and it didn't register, but it seems like it would not only fulfill the requirements of the application, but it'd be an easier implementation!
 

Posts:105
Registered: 6/8/04
Re: Track File Usage in Java  
Aug 3, 2004 12:01 PM (reply 17 of 23)



 
There may be a way to estimate how often a user uses a file by looking at the file's last access dates. For example, have your download manager check and record the last access dates of all the files it has downloaded whenever it starts up. Then, by analyzing how often the last access date changes and how recently the file has last been accessed, you may be able to come up with a decent estimation.

The standard API's don't (as far as I know) let you see the date of last access, but I'm sure there are other API's out there that will help you.
 

Posts:79
Registered: 5/1/02
Re: Track File Usage in Java  
Aug 3, 2004 12:06 PM (reply 18 of 23)



 
That makes sense RiORius but it seems to be not worth doing it for just for that minor user requirement (yes it's just a minor requirement.lol)

The File class (or some related class) has a lastAccessedTIme method (or something like that). But the thing is, what if the user accesses this files more often with the download manager closed. And no, we dont have some background wiki/./Windows thingy that monitors stuff. It's just pure Java and some XML =)
 

Posts:19
Registered: 8/3/04
Re: Track File Usage in Java  
Aug 3, 2004 12:07 PM (reply 19 of 23)



 
I'm not exactly sure how Windows keeps a tally of the frequency of use, but it does track the last opened programs in the registry. If you navigate to

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\

You can see some options related to functions of Windows Explorer. One of them may track the number of accessed times. Perhaps the Desktop Cleaner and the access counter are related?

 

Posts:14,142
Registered: 99-04-02
Re: Track File Usage in Java  
Aug 3, 2004 2:17 PM (reply 20 of 23)



 
Well, in theory, every application executed would have to go thru some initialization steps to get running, so it wouldn't seem hard for the OS to track app usage, I guess. Likewise, it would seem the OS could track files opened so long as it was done thru the Windows Explorer (double-clicking icons or whatever), as this has to do a check to see what app to use. Of course, a file opened from within an app may not have to conform to any notification subsystem requirements of the OS. And that's for Windows, and maybe Macs as well, but who knows about *nix systems. So I guess it could be done, but I doubt even Windows has that functionality built in (maybe API hooks could get you close).
 

Posts:19
Registered: 8/3/04
Re: Track File Usage in Java  
Aug 3, 2004 2:21 PM (reply 21 of 23)



 
Well, Windows XP does, which is the feature he's talking about. Somewhere, it keeps a tally of how often you use things and then you can evaluate which programs you don't use often to clean up your drive. Also, I should clarify, when I say Windows Explorer, I'm referring to the actual core of Windows itself, Explorer, not the file browser. I usually refer to the file browser as just that, or even "My Computer" to avoid confusion.
 

Posts:14,142
Registered: 99-04-02
Re: Track File Usage in Java  
Aug 3, 2004 2:25 PM (reply 22 of 23)



 
of course..., and that's why you need 10 GB free space for Windows XP and 512 MB memory just to run things at a normal speed... :)
 

Posts:403
Registered: 9/4/03
Re: Track File Usage in Java  
Aug 5, 2004 10:09 AM (reply 23 of 23)



 
I agree with what has already been said. Scrap the requirement... I don't really see any benefit to having it. It seems that the last access date should be more than enough.

I don't know very many users that would actually want a piece of software tracking what they have accessed on their machine and how often.

Just my 2 cents.
 
This topic has 23 replies on 2 pages.    « Previous | 1 | 2 |