# Change VirtualFile direction

**URL:** <https://forum.generic-mapping-tools.org/t/change-virtualfile-direction/1079>\
**Category:** Q&A\
**Created:** [November 24, 2020, 6:49pm UTC](https://forum.generic-mapping-tools.org/t/change-virtualfile-direction/1079 "2020-11-24T18:49:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarzeaud](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/sarzeaud/32/699_2.png) [@sarzeaud](https://forum.generic-mapping-tools.org/u/sarzeaud)\
**Post date:** [November 24, 2020, 6:49pm UTC](https://forum.generic-mapping-tools.org/t/change-virtualfile-direction/1079/1 "2020-11-24T18:49:28Z")

</div>

Hello,

Sometimes, one needs to reuse a file generated by a module in another one. A typical case is generating a cpt file with grd2cpt to be used later with grdimage. When using the API, we can first open a VirtualFile in GMT\_OUT mode to give a name (-\>name) to grd2cpt. But can this name be used (that is in GMT\_IN mode) for the -C option of grdimage?  
Thanks for your Help.

Olivier

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [November 24, 2020, 7:09pm UTC](https://forum.generic-mapping-tools.org/t/change-virtualfile-direction/1079/2 "2020-11-24T19:09:41Z")

</div>

Should be OK to do via [GMT\_Init\_VirtualFile](https://docs.generic-mapping-tools.org/dev/api.html#gmt-init-virtualfile)
