Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > MSDOS Programmer > Re: Changing Fi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 17 Topic 401 of 501
Post > Topic >>

Re: Changing File Date...

by Herbert Kleebauer <klee@[EMAIL PROTECTED] > May 27, 2006 at 05:18 PM

Wildman wrote:
> On Fri, 26 May 2006 16:11:29 -0700, JoAnne <mwsoft@[EMAIL PROTECTED]
> wrote:

> either in-line assembly or assembly librarys, you can do it
> using INT 21h AX=5701. 
 
> There is a down side.  If the basic program or dos utility
> is running on a windows platform, the drive must be
> locked first and then unlocked.

Why do you think the drive has to be locked? The following
batch sets the date of all files in the current directory
to Dec 1999 and works in Win9x and W2k. But because it uses 
INT 21h AX=5701 it only sets the "last modified" but not the
creation date.

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@[EMAIL PROTECTED]
 off
if not [%1]==[] goto sub
echo Bj@[EMAIL PROTECTED]
(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>_sd.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@[EMAIL PROTECTED]
 WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>_sd.com
echo ?@[EMAIL PROTECTED]
>>_sd.com
echo ?wEd@[EMAIL PROTECTED]
>>_sd.com
echo R@[EMAIL PROTECTED]
>>_sd.com
echo ??????0x>>_sd.com

for %%i in (*.*) do call %0 %%i
del _sd.com
goto ende

:sub
::      yyyy mm dd hh mm ss
_sd.com 1999 12 24 18 33 17 >>%1

:ende
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

The source code:

; 12.9.01 setzt datei datum von stdout
; setdat yyyy mm dd hh mm ss >>infile

        @[EMAIL PROTECTED]
        move.w  #$81,r5
        movu.bw -1.b(r5.w),r2
        bsr.w   get_number      ; jahr
        move.w  r3,r1
        sub.w   #1980,r1
        lsl.w   #4,r1
        bsr.w   get_number      ; monat
        and.w   #$000f,r3
        or.w    r3,r1
        lsl.w   #5,r1
        bsr.w   get_number      ; tag
        and.w   #$001f,r3
        or.w    r3,r1

        bsr.w   get_number      ; stunde
        move.w  r3,r4
        lsl.w   #6,r4
        bsr.w   get_number      ; minute
        and.w   #$003f,r3
        or.w    r3,r4
        lsl.w   #5,r4
        bsr.w   get_number      ; sekunde
        lsr.w   #1,r3
        and.w   #$003f,r3
        or.w    r3,r4
        move.w  r4,r2
        move.w  #$5701,r0
        move.w  #1,r3
        trap    #$21
        rts.w

        
get_number:
        eor.l   r3,r3
        move.w  #_10,_200
_10:    dec.w   r2
        bmi.b   _100
        movu.bl (r5.w),r0
        inc.w   r5
        cmp.b   #'0',r0
        blo.b   _20
        cmp.b   #'9',r0
        bhi.b   _20
        sub.b   #'0',r0
        mulsq.l #10,r3,r3
        add.l   r0,r3
        move.w  #_100,_200
        br.b    _10
_20:    jmp.w   (_200)
_100:   rts.w
_200:   dc.w    0

k10:    dc.l    10
 




 17 Posts in Topic:
Changing File Date...
JoAnne <mwsoft@[EMAIL   2006-05-26 16:11:29 
Re: Changing File Date...
Wildman <wildman@[EMAI  2006-05-26 22:30:29 
Re: Changing File Date...
Herbert Kleebauer <kle  2006-05-27 17:18:24 
Re: Changing File Date...
Wildman <wildman@[EMAI  2006-05-27 15:28:48 
Re: Changing File Date...
erewhon@[EMAIL PROTECTED]  2006-05-27 10:22:27 
Re: Changing File Date...
JoAnne <mwsoft@[EMAIL   2006-05-27 16:27:51 
Re: Changing File Date...
erewhon@[EMAIL PROTECTED]  2006-05-28 13:47:43 
Re: Changing File Date...
Herbert Kleebauer <kle  2006-05-28 16:44:59 
Re: Changing File Date...
JoAnne <mwsoft@[EMAIL   2006-05-29 14:03:40 
Re: Changing File Date...
Herbert Kleebauer <kle  2006-05-30 00:07:31 
Re: Changing File Date...
Wildman <wildman@[EMAI  2006-05-30 19:10:22 
Re: Changing File Date...
Herbert Kleebauer <kle  2006-05-31 12:41:46 
Re: Changing File Date...
Wildman <wildman@[EMAI  2006-05-31 07:29:59 
Re: Changing File Date...
Herbert Kleebauer <kle  2006-05-31 15:30:13 
Re: Changing File Date...
Wildman <wildman@[EMAI  2006-06-02 19:43:21 
Re: Changing File Date...
Dr John Stockton <jrs@  2006-05-28 21:27:23 
Re: Changing File Date...
Timo Salmi <ts@[EMAIL   2006-05-31 07:54:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 22:47:58 CDT 2008.