  | | | MEL: Creating a new file | MEL: Creating a new file 2003-12-08 - By Andrew Chapman
Back Andrew Chapman wrote: > Taisuke Tanimura wrote: > >>I have a MEL script that saves some animation data out to file. I've run >>into a problem when I want to save the data out to a new file - there >>doesn't seem to be an way in MEL to have the user "pick" a file that >>doesn't exist and have the path to that non-existent file returned. The >>fileDialog command only returns a string if the user picks an existing >>file. I could work around it by popping up a text box and have the user >>manually enter the full path and then create the file via fopen, but it >>would be nice to use the file picker to do this. Has anyone had similar >>problems or know of a workaround? Thanks! > > You could start with a base name, and append increasing numbers to the > end until you find one that doesn't exist. Use fopen() in read mode to > test for file existence (would be nice if the sysFile command had a > -exists flag wouldn't it?).
Erm, yeah... totally misread that post sorry ;)
I thought you were after a way to create a tempfile and be sure it wasn't one that already existed.
Just ignore me, I've been working too long...
-- Andrew Chapman 3D Technical Director - Framestore CFC
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-archive: <http://www.highend3d.com/maya/devarchive/>
|
|
 |