FOR %%i IN (*.las) DO laszip.exe -i %%i && DEL %%i
Because the DEL command requires an exit code of 0 from the preceding command, I can't think of any potential landmines to running the command in this way. But the down side is you can't parallelize the process by using multiple cores and it delves into realms of DOS that most people become seriously uncomfortable with. However there are other ways that the conditional && operator could be used and I ended up discouraging it because I don't know enough about how lastools collects and reports errors to the shell on exit. So, my question is;
How does Lastools handle error reporting to the shell. Is is a return code of 0 from main () provided if the last iteration/child process completes successfully or does lastools collect errors from previous iterations/children and return an exit code with intelligent design to signify special meaning to the user? For instance;
laszip -i *.las && DEL *.las
or
laszip –cores 8 –i *.las && DEL *.las
If there were 1000 tiles in the directory and the first 999 fail for unknown reasons but the last file zip's successfully, what exit code does laszip (or other tool) return. If the program returns 0, all the las files would be deleted upon exit (maybe bad). A value of 1 would prevent DEL from being executed, but it's conceivable that additional codes could be returned to indicate the nature and quantity of errors encountered (best, but may be of limited practical use).
Cheers,
Mike
--
Download LAStools at
http://lastools.org
http://rapidlasso.com
Be social with LAStools at
http://facebook.com/LAStools
http://twitter.com/LAStools
http://linkedin.com/groups/LAStools-4408378
Manage your settings at
http://groups.google.com/group/lastools/subscribe