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
  02 February 2008
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
  02 February 2008

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 ||
  02 February 2008
Great help, thanks alot
  03 March 2008
Hi, also basenameEx( $filePath ) will give you the scene name without the directory or the file extension.
  03 March 2008
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 11:09 PM.

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