Common interface for dumping data to disk