[LC++]Copying files and deleting directories

Jan Pfeifer pfjan at yahoo.com.br
Thu Sep 9 08:30:02 UTC 2004


hi Jack,

about the speed, I once tried to do a cp as fast as the gnu cp and 
didn't manage to do it. I think it used mmap or something like that. So, 
in fact, depending on the case, it could be faster than a direct 
implementation of the copy functionality. If one have _many_ files to 
copy, the shell invocation is surely slow.

about security, you're totally right. Removing any "'" (apostrophe) 
character, sorrounding the file names with apostrophes and escaping 
initial "-" should do the job.

jan


>a) This is pretty slow.
>
>b) Depending on the application, you've got to make sure your filenames' don't
>   contain `rm -rf $HOME` or similiar, as the shell will happily execute that.
>
>-Jack
>
>_______________________________________________
>This is the Linux C++ Programming List
>: http://lists.linux.org.au/listinfo/tuxcpprogramming List
>
>  
>





More information about the tuxCPProgramming mailing list