Beginner need help

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
Beginner need help

Submitted by Anonymous on Wed, 10/17/2001 - 15:51. Developers
I want to remove temp file in my program, but I can`t find function to complete this task, how can I do?

Thanks in advance

ICS_support

You probably want unlink() or its more recent form, remove().

But the real trick is getting a temporary name to begin with that doesn`t interfere with other programs. See tmpfile(), which may be tmpnam() on your system.

In order to make this posting relevant to Motif, I should say that Open Motif itself is quite portable, but you are of course also dealing with the underlying operating system and file system. Open Motif hides its details for you -- see lib/Xm/Xmos.c for how this is done -- but your application will likely need to deal with files and such and vagaries of C. Ideally, people would use ANSI C (more properly, ISO C) and code portably. Even if the program isn`t being deployed on multiple systems, it would likely be easier to maintain if it doesn`t depend on routines that in future O.S. versions could be moved to compatibility libraries or cease to work. End ObMotif.