home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!comp.vuw.ac.nz!waikato.ac.nz!ldo
- From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
- Newsgroups: comp.sys.mac.hypercard
- Subject: Re: XCMD and filename HELP!!!
- Message-ID: <1992Jul30.173712.9751@waikato.ac.nz>
- Date: 30 Jul 92 17:37:12 +1200
- References: <1992Jul28.111201.21732@nuscc.nus.sg>
- Organization: University of Waikato, Hamilton, New Zealand
- Lines: 41
-
- In article <1992Jul28.111201.21732@nuscc.nus.sg>, taihou@shankar.iss.nus.sg (Tng Tai Hou) writes:
- > Unfortunatelly, I run into some coding problems in manipulating
- > files. Internally, my code must require both the correct
- > vRefNum and a pascal filename:
- >
- > OSErr ShowTarga (short vRefNum, StringPtr fn, short x, short y);
- >
- > I really don't understand it at all. The only way I got this to
- > work was to follow exactly the following:
- >
- > 1. Make sure that my folder or stack is 1 level in the hard disk and
- > not anywhere else, including the desktop.
- > 2. I must write my code such that vRefNum is zer0 for the default volume.
- > 3. Then from HyperCard, I must specify the FULL path:
- > "Volume:MyFolder:MyTargaFile"
- >
- > Is there a more generic way of writing this? I need both the vRefNum,
- > and the filename.
-
- I take it you didn't write the ShowTarga routine. :-)
-
- Apple's recommended way of referring to a file involves specifying three
- pieces of information:
- * the volume refnum
- * the parent directory ID
- * the name of the file.
-
- Software that dates from pre-HFS days doesn't know about directory IDs.
- For such code, there is a hack involving strange entities called "working
- directories". You can find the gory details in the File Manager chapter of
- Inside Macintosh Vol IV. Basically you can create a working directory to
- represent a directory on a volume, and then pass that WD refnum to code
- that expects a volume refnum. Trouble is, there is a limit to the total
- number of WDs that can exist at any time, and managing the damn things can
- get to be a pain.
-
- Lawrence D'Oliveiro fone: +64-7-856-2889
- Computer Services Dept fax: +64-7-838-4066
- University of Waikato electric mail: ldo@waikato.ac.nz
- Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
- I don't claim to be consistent. Yes I do!
-