How would I see how many times a file has been written to?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How would I see how many times a file has been written to?
I have been making a game on a single computer, on the same location using Gedit and Vim. I heard about the 'Game in a day' contests and this prompted a thought; How long had development for my game gone on for, in hours, or revisions. I was wondering if there was a way to see how many times a file had been written to (On average I spent 10 minutes with it open, as there are long coding periods (about an hour) and shorter bug fixes) so I could see how long I had been working on it.
Even better than this would be to see how long it had been. I do not know any commands that could do this, are there any at all?
Why don't you use version control for your code? That way, you can track the changes. I'm not sure which version control systems allow you to see changes on a per-file basis, but I imagine it can be done (I've only got a basic knowledge of SVN).
Why don't you use version control for your code? That way, you can track the changes. I'm not sure which version control systems allow you to see changes on a per-file basis, but I imagine it can be done (I've only got a basic knowledge of SVN).
I will probably look into that now.
I know I compiled it for Windows on 23rd August and I had been working on it for at least 10 days, so probably averaging 20 minutes a day since then.
There isn't any command to track how many times a file was written to, or how long it had been opened. The best you can do is when was the last modification or read access.
As for keeping track of your commits, SVN is good but it requires more of a central repository. I would instead suggest using 'git' as it does not need a central repository and you can initialize an active project easily, using 'git init /path/to/project'. However, neither SVN nor git can tell you how long you have been working on a file, it will only show when you committed your changes.
Well, for one thing there's FUSE loggedfs and you probably could do something with inotify too.
Sorry, I should have mentioned I meant, for an existing file already. Yes, I am sure there are tools that can record access to a file, but needs to be setup a head of time, and I don't think that is what the OP was asking. Could be wrong, it's been a long day. :-)
Sorry, I should have mentioned I meant, for an existing file already. Yes, I am sure there are tools that can record access to a file, but needs to be setup a head of time, and I don't think that is what the OP was asking. Could be wrong, it's been a long day. :-)
Ah, ok. I think I can work out an estimate and then I will go and use a versioning control system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.