[Webinar] Streamline your web hosting managementRegister Today


File attriibute modified???

Posted on 1999-12-15
Medium Priority
Last Modified: 2010-04-15
Can anyone tell me how to check to see if a file has been modified since it was last read in?  I'm using C++, and running on a dos platform.
Question by:nkeene
  • 2
LVL 16

Accepted Solution

imladris earned 150 total points
ID: 2285099
DOS function 0x43 is Change File Mode. It allows you to set or read the attribute associated with a file. DOS resets the archive bit whenever a file is modified. So if you set the archive bits on any files you wish to monitor. Then, after that, whenever you find the bit has been reset, you will know the file has been modified in the interim.

DOS function calls are initiated by placing the function number in AH, any parameters, then issueing a interrupt type 0x21.
Parameters in this case are DS:DX to point to a string with drive path and filename of file. If AL is 1, the file attribute will be set to the contents of CX. If it is 0, the file attribute will be returned in CX.

OR, depending on what compiler you are using, there should be some function in the library that will do a doscall for you.
LVL 16

Expert Comment

ID: 2285101
P.S. the archive bit is bit 5, i.e. mask with 0x20.

Featured Post

The Lifecycle Approach to Managing Security Policy

Managing application connectivity and security policies can be achieved more effectively when following a framework that automates repeatable processes and ensures that the right activities are performed in the right order.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
Suggested Courses

640 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question