Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving file into a subfolder

Status
Not open for further replies.

MZimmerman6

Programmer
Jun 21, 2010
5
US
I was just wondering how to go about saving a file into a subfolder of the my current directory.

I have the whole saving and writing to files down, but I can not get my program to get its current directory and then save a file into a folder inside of said directory. For some reason there is not much information about this online that I can find. Any help is greatly appreciated. Thanks a lot!
 
Does the subdirectory exist?
If so:
Code:
set newdir [pwd]/$subdirname

If not:
Code:
file mkdir [pwd]/$subdirname
then as above.

_________________
Bob Rashkin
 
Thanks a lot. I did not know about the pwd command. That will definitely come in handy. Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top