This article was previously published under Q40887
This article has been archived. It is offered "as is" and will no longer be updated.
Below is a Macintosh QuickBASIC Version 1.00 program that makes a fileinvisible on the Macintosh desktop. Even though it is invisible, thefile can still be accessed by an application and can be read andwritten to, e.g. QuickBASIC can still open the file.
The program example uses the GetFileInfo and SetFileInfo routines(i.e., MBLC routines in QuickBASIC), which are not provided in earlierreleases of BASIC interpreter or compiler for Macintosh.
The following is a program example:
' Hides a visible file or unhides an invisible fileDEFINT A-ZDIM FILEINFO(40)FILENAME$ = "myfile"GetFileInfo FILENAME$,FILEINFO(0)FILEINFO(20) = FILEINFO(20) XOR 16384SetFileInfo FILENAME$,FILEINFO(0)END
The contents of the FILEINFO array can be found in "Inside Macintosh"Volume II on Page 116 (by Apple Inc., published by Addison-Wesley). Inthis array, the Finder information is stored in parameter block 32(i.e., element 16 in the array). The Finder information block is 16bytes long. These 16 bytes are described on Page 130. They are asfollows: