![]() |
| ||
| c++ or shell script to delete some files Hi, Could someone tell me how I can delete files using a shell script or c++? The condition for deleting files: compare all files (say *.deb files) in folder A to those in folder B. If any file in B is also contained A, then delete the one in B. This could probably done in two lines of shell scripting but I'm very new to programming. Thanks in advance for your help. Regards, h.y. |
| ||
| Re: c++ or shell script to delete some files what operating system? MS-Windows? use FindFirstFile() and FindNextFile() to get a list of all the files in dir A, store the filenames in a string array. Then use the same functions to get the files in directory B. For each file in B search the array of filenames you created from directory A, if found the delete the file. |
| ||
| Re: c++ or shell script to delete some files Thanks. I use Ubuntu and Windows. I'm looking for a shell script that does this. But I'll try what you're saying as well. Thanks. |
| ||
| Re: c++ or shell script to delete some files Quote:
#!/bin/bash |
| ||
| Re: c++ or shell script to delete some files Quote:
|
| All times are GMT -4. The time now is 5:57 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC