ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
Hi, I have a very limited knowledge of programming, but I need to write a program that will go into a particular folder and delete anything in it that was not created the same day the program is run. I need it to be in either c or c++. I'll put this to run everytime someone logs on to the computer so I need it to check the day, not time specifically. Thanks.
Since you aren't a programmer (and I don't know why you'd want it in C/C++), how about a cron job that runs every midnight, and deletes everything in the specified directory?
Hi, I have a very limited knowledge of programming, but I need to write a program that will go into a particular folder and delete anything in it that was not created the same day the program is run. I need it to be in either c or c++. I'll put this to run everytime someone logs on to the computer so I need it to check the day, not time specifically. Thanks.
Hows about calling somethin like this when the profile is loaded?
No, its not a homework question, I took C++ class 6 years ago and don't remember anything except very basic and general information. This is gonna run on a windows machine, they're for the biology lab laptops which students use. We don't leave them running 24/7 and they're not connected to the server so that we can tell them to turn on and run anything at midnight. So I just need a quick program that does the deleting everytime the student turns and logs on the laptop. Trust me if it ran Linux I wouldn't be asking for help, but the school makes the decision on what to run on them not me . Thanks a bunch guys.
ok it doesn't matter if its c or c++, but I need something that isn't done in a scripting language like perl. I already wrote the program in Perl and I was told it would be best if I didn't write it in as a script. Can anyone help?
No one I know would even think of doing such a task in C/C++. Wrong tool for the job. It makes a trivial job into a significant project. There is a reason scripting langugaes like perl were invented, and this is one of them. What reason(s) were you given that C/C++ would be best?
--- rod.
Thanks for the info on making it run on login and how to get rid of the folder. now I need to know how to compare the date stamp on files to todays date (time in hours or seconds not necessary).
The reason for C/C++ is a stupid one: beaurocracy. Everything that goes on the college computers has to be approved by the college, and they don't want to put in a scripting compiler (is it called a compiler?) in the laptops. They already have MS Visual C++ or something MS-ey on them and would rather use that instead. I'm trying my best here come up with the code myself, and I think C++ is giving me more to work with, but I still need help.
Thanks for the patience and time, I really appreciate it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.