geomagpy / magpy

MagPy (or GeomagPy) is a Python package for analysing and displaying geomagnetic data.
BSD 3-Clause "New" or "Revised" License
45 stars 27 forks source link

prevent creating directory #80

Closed leonro closed 6 years ago

leonro commented 6 years ago

Charles Blais: Is there a way to prevent the write command to create a directory and just create a file? The reason is because, security wise, if I can write the content of the data into memory (ex: python StringIO) for things like a web service, it prevents the web server to have write access.

leonro commented 6 years ago

This possibilty is included (currently only for IAGA output) with 7dda6d54470628cdc9c81a3de1745ce909646767

How to do it: mem = data.write("StringIO", format_type='IAGA') content = mem.getvalue() print (content) mem.close()