i am not sure whats ur exact problem ...........but i used your code,
compiled it and tried to execute it. i think it works fine
ur program copies file from the source file to the destination file
based upon the filter. so if ur filter is "public" all the lines from
the source file which have the word public in it are copied into the
destination file
if this is what was intended then boy u r right on target.