Changing File Attributes

 BBS: Inland Empire Archive
Date: 03-16-92 (22:40)             Number: 125
From: JODY BURROW                  Refer#: NONE
  To: SCOTT LEVENTHAL               Recvd: NO  
Subj: Changing File Attributes       Conf: (2) Quik_Bas
SL>I need to be able to change the file attributes of a 0-byte file from a
SL>QuickBASIC 4.0b program.  Specifically, I intend to use a 0-byte file as a
SL>flag.  In addition to QB4, I am also using Harold Thomson's QB4BAS routines
SL>(loading via the $INCLUDE metacommand).  Anyway, can anyone tell me how,
SL>after I have created the 0-byte file, I can turn its
SL>'hidden' file attribute
SL>on or off from a QuickBASIC program?

You call Interrupt 21h, function 43h setting the following:

AH=43h

AL=0 to get the current attribute
   1 to set the current attribute

CX=bit pattern as follows
   7 6 5 4 3 2 1 0
   0 0             Reserved, leave as 0
       x           Archive flag
         0         Leave as 0
           0       Leave as 0
             x     System
               x   Hidden
                 x Read-Only
0 where an x is means the attribute is off, 1 means it is on.

DX=offset of null-terminated string of full path name
DS=segment of null-terminated string of full path name

Just call like a normal interrupt using CALL INTERRUPTX routines and its
a piece of cake!
--- GEcho/beta
 * Origin: Telen-Quest, Simply D'Best! % 1.2Gig Multiline Strong (1:284/4)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET