[futurebasic] FSSpec *fileSpec

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2000 : Group Archive : Group : All Groups

From: Flavio Scarponi <flavio.scarponi@...>
Date: Wed, 01 Mar 2000 11:44:09 +0100
Dear Robert,
I send you some code to get the FSSspec.
use fn GeneraFSSpec% accluded. Variable names are in my mother
If you need, iIwill send an international version!
I see you are working on a Pitc to QT project.
I have to do it with FB ^3!
Would you like (someone else too!)to  do it togheter?

NomeFile should be dim as 63 String!
NomeFile$ and FolderWD% come from a files$ statement.(user opens..)

clear local
local fn TrovaId&(FolderWD%)
DIM pbBlock.128,Dirname$,OSErr%
pbBlock.ioDrDirID& = 0
pbBlock.ioNamePtr&      = @Dirname$'puntatore al nome
pbBlock.ioVRefNum%      = FolderWD%'parte da vRefNun
pbBlock.ioFDirIndex%    = -1'info su folder
OSErr% = FN GETCATINFO (@pbBlock)
end fn = pbBlock.ioDrDirID&

clear local
local fn TrovaVolume%(FolderWD%)
dim pbBlock.128,OSErr%
dim 32 NomeFolder$
pbBlock.ioNamePtr& = @NomeFolder$
pbBlock.ioVRefNum% = FolderWD%
pbBlock.ioWDVRefNum% = 0
pbBlock.ioWDIndex% = 0
OSErr% = FN PBGetWDInfoSync(@pbBlock)
end fn = pbBlock.ioWDVRefNum%

clear local
local fn GeneraFSSpec% (NomeFile$,FolderWD%,StandardFile as pointer to
'USE THIS with USER'S Imported Files; results on StandardFile
dim OSErr%,Directory&,Volume%
Directory& = fn TrovaId&(FolderWD%)
Volume% = fn TrovaVolume%(FolderWD%)
OSErr% = FN FSMakeFSSpec(Volume%,Directory&,NomeFile$,#StandardFile)
end fn = OSErr%'Check it (to be shure that file exists & is there!)