Does anyone know if there is a way to get the amount of free disk space using the FME Server API? I presume I could use a SystemCaller transformer and write out the information somewhere and access it that way, but wondering if there is an easier way. Just looking to get the same disk space details that are logged when a job runs (see screenshot). Thanks
Solved
Get available disk space programmatically using FME Server API?
Best answer by virtualcitymatt
You can use python to get that info easy enough:
modified from https://stackoverflow.com/questions/48929553/get-hard-disk-size-in-python
import fme
import fmeobjects
import shutil
def GetSize(object):
total, used, free = shutil.disk_usage("/")
object.setAttribute("Total",(total // (2**30)))
object.setAttribute("Used",(used // (2**30)))
object.setAttribute("Free",(free // (2**30)))
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.



