Get path of a file and filename

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 02 February 2008   #1
Get path of a file and filename

I want to get path location of file to a variable, I know file -location parameter but It cant give the exact path but also the file name :

A second question, how I get the file name in to a variable.

Thanks for your help, I am really noob in mel
Old 02 February 2008   #2

is this what you are after ?

string $filePath = `file -q -sceneName`; // get the current scene's full path
string $fileName = basename ($filePath,".ma"); // get the file name
string $dirname = dirname( $filePath );// get the directory of the current scene

|| Loka samastaa sukhino bhavantu ||
Old 02 February 2008   #3
Great help, thanks alot
Old 03 March 2008   #4
Hi, also basenameEx( $filePath ) will give you the scene name without the directory or the file extension.
Old 03 March 2008   #5
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 08:26 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.