PDA

View Full Version : howto expand 8+3 type filepaths?


brubin
12-09-2003, 09:24 PM
hi,
is there someone out there who is DOS - literate as well as fit in MEL, who can help me out with this weirdness of maya-on-NT:

if you use `internalVar -userTmpDir` or `getenv TMP` in order to findout the current users temp-folder you might end up with a result resembling this:

// Result: C:/DOKUME~1/ADMINI~1/LOKALE~1/Temp //

problem now is - it seems to me as if MEL cannot use this as a ┬┤real┬┤ path, even if you convert all the "/" to "\\"
and it looks shitty, too!

(i'm trying to create a file in TEMP, which is the only option in order to make the script platform independant; but for reasons beyond me i can't get "fopen" to work with a path that uses the *crippled* form of the temp-path. if you can come up with some lines of code that can declare a filename in TEMP utilizing the "internalVar"-command, and after that "fopen" the file for "fwrite" successfully, that would do me *very* nicely as an answer to this question!) :)

or:
can someone tell me if there is a "pwd" -equivalent that prints the path in long-form and nice? can be a system-call as well, i mean like a DOS command etc.

TIA
s.

Marcel
12-10-2003, 12:58 PM
For platform independence, can't you use the 'Project' directory? This is what I did for a small exporter:

string $project_dir = `workspace -q -fn`;
string $location = $project_dir + "/" + "export";

When no project is set Maya will take the default project directory.

CGTalk Moderation
01-16-2006, 10:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.