Возможно ли, что мы можем узнать свободное место на любом диске с помощью Ant Script, потому что я копирую одну папку размером 300 МБ в свой сценарий развертывания ant, поэтому я хочу подтвердить перед копированием, что в нем более 300 МБдиск.
Посмотрите на свободное пространство: http://ant.apache.org/manual/Tasks/conditions.html
<?xml version="1.0"?> <project name="test" default="test" basedir="."> <target name="test" depends="exists,not-exists"> <echo message="Test target"/> </target> <target name="exists" if="space-exists"> <echo message="Space exists"/> </target> <target name="not-exists" unless="space-exists"> <echo message="Space does not exist"/> </target> <condition property="space-exists"> <!-- Change this to 10000G to see it failing --> <hasfreespace partition="/" needed="1M"/> </condition> </project>