Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > New Directory

New Directory
Thread Tools
Snuffub
Guest
Status:
Reply With Quote
Jan 12, 2001, 12:11 AM
 
How the hell do i A) access files in a directory other than the project's root folder ie ifstream in("thefolderIWant/ThefileIWant");

and B) how do i create a new folder???

these things seem to be basic concepts that hsould be easy to find but i cant find anything anywhere/// help!
     
Dedicated MacNNer
Join Date: Nov 1999
Location: Georgetown, Demerara, Guyana
Status: Offline
Reply With Quote
Jan 12, 2001, 07:50 PM
 
Hi Snuffub,

The answers might partly depend on which IDE/platform you're using...

For A), if you're using MW CodeWarrior under "Classic" Mac OS, then you could just use the standard Mac OS full-pathname format -- "some volume:[some folder:...]:some file" (e.g., "Macintosh HD:Applications:SimpleText Folder:Sample File"). Or, you could even use a partial-pathname beginning with multiple consecutive colons (e.g., to specify a file in some sibling-folder of your app's immediate parent-folder, you could use "::some parent's-sibling folder:some file"). A single initial colon denotes the immediate parent-folder; and, the more initial colons you specify, the higher up you'll "back out" of the immediate parent-folder. (This is similar to the standard DOS/Windows partial-path notation of multiple consecutive dots.)

For B), again, if you're using MW CodeWarrior (or any ANSI-compliant C/C++ compiler) under "Classic" Mac OS, then one relatively standard technique would be to use the 'mkdir' function (it's C but like most C routines, it works okay from C++; you'd just need to #include <stat.h> ). You could specify the desired folder's path in any of the standard Mac OS path formats (it's also best to terminate the path with a colon).

Regards,

--Paul
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:06 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2