[comp.sys.mac.programmer] File Manager questions

joeb@hpmwtd.HP.COM (Joe Ballantyne) (03/17/89)

I am writing an application that creates some very
large contiguous files using File Manager routines.
I want to be sure that the files are always contiguous
even when they are copied by the Finder from one disk
to another. 

Will the Finder always copy a contiguous file as a 
contiguous file?

Is it possible to force the Finder to keep a file
a contiguous file?  If so, how is this done?

I had the brilliant? idea that if I set the file clump
size of my contiguous file to the size of the file
itself, then perhaps the finder would use the original
file's clump size when allocating space on the
disk for the copy.  Is that true?
(I'm beginning to have my doubts.)

Unfortunately, I have found it impossible (so far) to
even set the file clump size.  I first tried using 
PBSetCatInfo. I set the file clump size feild
to the value that I wanted, called PBSetCatInfo, recalled
PBGetCatInfo, and the clump size had been conveniently
set to zero for me.

I then decided that Pascal wouldn't do it for me, so I tried
machine language.  I found the files file control block, set
the clump size long word directly in the file control block,
set the dirty bit (bit 15) of the ioflags word, set the file 
has its own clump size bit (bit 6) of the ioflags word, jumped
back to my program, (everything seemingly ok) called flushvol,
and naturally, the system crashed.  

Is it possible to set a file's clump size to something other
than zero?

If I didn't set bit 15 in my assembly language subroutine, 
the flushvol and subsequent file manager
calls worked fine, BUT when I checked the file clump size with
FEdit Plus, it was zero.  

Do I need to set bit 7 of the ioflags word?

How does one set the clump size of a file in a permanant
manner?  Do you have to access the B* trees directly?

Thanks in advance for your help

Joe Ballantyne
Hewlett Packard
Microwave Technology Division
Santa Rosa, CA 95405

joeb@hpmwjcb.HP.COM

resnick@cogsci.uiuc.edu (Pete Resnick) (10/23/90)

Two questions, one which I had asked long ago but have forgotten
the answer to:

1. I am reading a file and sending it over a TCP connection. That means
I have to convert newline's to CR/LF and not take any non-ASCII
characters. Assuming that the file I am reading has been typed in
TeachText or some other text editor, what will be the easiest way to
read it in the right format? (I am assuming that autowraps don't count
here and that they are not in the file I am reading. Correct me if this
is mistaken).

2. This file reading is going to be done by a device driver during accRun
time. Is it possible to leave the file open between accRun calls? In other
words, can I open the file into the system heap so that it wont be closed
when an application exits?

Sorry if these are repeats of old questions.

pr
--
Pete Resnick             (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet/ARPAnet/EDUnet  : resnick@cogsci.uiuc.edu
BITNET (if no other way) : FREE0285@UIUCVMD

resnick@cogsci.uiuc.edu (Pete Resnick) (06/03/91)

Two questions about the File Manager:

1. What routines that are documented in IM VI (if any) are available in
System 6.0.x? I am especially interested in whether PBHOpenDF will work
under 6.0.x. (As an aside, what about Resource Manager routines like
HOpenResFile?)

2. When a completion routine gets called for, say, PBRead, I know I get
the paramBlock in A0. Do I get it on the stack by any chance also? If not,
is there any way to get at it besides my C code having a "asm {move A0,myPB}"
in the middle of my code? How do people do it in Pascal? And what should
the declaration of the completion routine look like? I couldn't find any
of this in either IM IV or IM VI.

pr
--
Pete Resnick             (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet/ARPAnet/EDUnet  : resnick@cogsci.uiuc.edu
BITNET (if no other way) : FREE0285@UIUCVMD

d88-jwa@byse.nada.kth.se (Jon W{tte) (06/03/91)

@ux1.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:

   1. What routines that are documented in IM VI (if any) are available in
   System 6.0.x? I am especially interested in whether PBHOpenDF will work
   under 6.0.x. (As an aside, what about Resource Manager routines like
   HOpenResFile?)

These kinds of routines (especially HOpenResFile) are just glue
routines for the PBH calls. They are avaiailable in the development
environment (THINK C 4, for instance) and work well with system 6.
This is documented in technote 200-something (14 ?)

--
						Jon W{tte
						h+@nada.kth.se
						- Speed !