1 /* touch.c : Defines the entry point for the console application.*/
2 /* Copyright 2000, International Business Machines Corporation and others.
5 This software has been released under the terms of the IBM Public
6 License. For details, see the LICENSE file in the top-level source
7 directory or online at http://www.openafs.org/dl/license10.html
18 #define intptr_t INT_PTR
24 printf("touch filename/Wildcard \n");
29 * Construct the mask explicitly. Later versions of windows start filling
30 * in higher bits and that doesn't affect the operation
33 #define ATTRIBUTE_MASK (_A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_SUBDIR)
37 main(int argc
, char *argv
[])
43 struct _finddata_t finfo
;
46 fs
= _findfirst(argv
[1], &finfo
);
51 if ((finfo
.attrib
& ATTRIBUTE_MASK
) != _A_NORMAL
)
53 fh
= _open(finfo
.name
, _S_IWRITE
| _O_BINARY
| _S_IREAD
| _O_RDWR
);
54 pos
= _lseek(fh
, 0L, SEEK_END
);
56 _write(fh
, buffer
, 1);
59 } while (_findnext(fs
, &finfo
) == 0);