Urgent help required!!!!! (using PB 3.1) 
Author Message
 Urgent help required!!!!! (using PB 3.1)

I also need to know.  Any language would be fine for me!  

Basically, all I need is source code for the TOUCH command.  I want to be
able
to set the date and such to a string that I supply.

Prefer Basic or C.  Thanks in advance!



Sat, 06 Dec 1997 03:00:00 GMT  
 Urgent help required!!!!! (using PB 3.1)
Hi,

 Does anyone know how to set or modify a files creation date?
 The example files that came with powerbasic only show how to read this info
 not how to set it!!   I cannot file any programming book which explains how
 to do this.

Thanks in advance.
Igor



Sat, 06 Dec 1997 03:00:00 GMT  
 Urgent help required!!!!! (using PB 3.1)
: Hi,

:  Does anyone know how to set or modify a files creation date?
:  The example files that came with PowerBASIC only show how to read this info
:  not how to set it!!   I cannot file any programming book which explains how
:  to do this.

: Thanks in advance.
: Igor

Hi Igor,

First of all I am not a PB-programmer, I'm using MS PDS 7.1. As a
consequence I don't know how the example that shows how to read a file's
timestamp works.
The solution I'm offering works via DOS-function calls that can be invoked
by interrupts (hasn't PB got in-line assembler?).

I took the following from some manual. It should be enough to hack your way
through and get everything you wanted. I won't spoil the pleasure of hacking
by a complete sample program. So here's what I got:

INTERRUPT 21h - Function 57h, subfunction 00h
GET FILE'S DATE AND TIME

Purpose: Reads date and time a file was last modified, as contained in the
file's directory information.
Available on: DOS 2.0 or higher       Restrictions: none
Registers at call:
AX = 5700h
BX = file handle
Return Registers:
CF clear if succesfull
   CX = File's time
     bits 15-11: hours (0-23)
          10-5: minutes
          4-0: seconds/2
   DX = File's date
     bits 15-9 = year - 1980
     bits 8-5= month
     bits 4-0= day
CF set on error
   AX = errorcode (01h, 06h) (see function 59h)
Conflicts: None known
See Also: Function 57h, subfunction 01h

INTERRUPT 21h - Function 57h, Subfunction 01h
SET FILE'S DATE AND TIME
Purpose: Changes file's last-modified date and time information to the
specified values.
Available on: DOS 2.0 or higher
Registers at call:
AX = 5701h
BX = file handle
CX = new time (see Function 57h, subfunction 00h)
DX = new date (see Function 57h, subfunction 00h)
Return registers:
CF clear if successfull
CF set on error
   AX = errorcode (01h, 06h) (see function 59h)
Conflicts: None known
See Also: Function 57h, subfunction 00h

Unfortunately I only now realise that I didn't look up how to get a file
handle via interrupts. Get to that later on ...

Good luck,

Marnix



Sun, 07 Dec 1997 03:00:00 GMT  
 Urgent help required!!!!! (using PB 3.1)
pool_i meinte am 20.06.95 zum Thema "Urgent help required!!!!! (using PB 3.1)"

Hello Igor!!

Quote:
>  Does anyone know how to set or modify a files creation date?

Yes :)

Quote:
>  The example files that came with PowerBASIC only show how to read this info
>  not how to set it!!   I cannot file any programming book which explains how
>  to do this.

I hope, you understand the german language, but I haven't enough time to
translate all source codes. If not, please ask me.

'*************************************************************************
'
'  Setzen des Datum und der Uhrzeit in PowerBASIC 3.0/3.1
'
'  von Thomas Gohel
'
'*************************************************************************

WriteDatum "demo.bas", "23.06.1995", "20:15:00"
END

FUNCTION WriteDatum(Datei$, Datum$, Zeit$) public
        LOCAL DateiSeg??, DateiOff??, DateiHandle%
        LOCAL DateiDatum%, DateiZeit%
        LOCAL Tag%, Monat%, Jahr%

        Datei$     = Datei$ + CHR$(0)
        DateiSeg?? = STRSEG(Datei$)
        DateiOff?? = STRPTR(Datei$)
        Jahr%      = VAL(RIGHT$(Datum$, 4))
        Monat%     = VAL(MID$(Datum$, 4, 2))
        Tag%       = VAL(LEFT$(Datum$, 2))
        Stunde%    = VAL(LEFT$(Zeit$,2))
        Minute%    = VAL(MID$(Zeit$,4,2))
        Sekunde%   = VAL(RIGHT$(Zeit$,2))

        ! mov cl, 5
        ! mov ax, Minute%
        ! shl ax, cl
        ! mov Minute%, ax
        ! mov cl, 11
        ! mov ax, Stunde%
        ! shl ax, cl
        ! mov Stunde%, ax
        ! mov cl, 5
        ! mov ax, Monat%
        ! shl ax, cl
        ! mov Monat%, ax
        ! mov ax, Jahr%
        ! sub ax, 1980
        ! mov cl, 9
        ! shl ax, cl
        ! mov Jahr%, ax

        ! mov ax, DateiDatum%
        ! mov bx, Jahr%
        ! mov cx, Monat%
        ! mov dx, Tag%
        ! xor ax, ax
        ! or  ax, bx
        ! or  ax, cx
        ! or  ax, dx
        ! mov DateiDatum%, ax
        ! mov ax, DateiZeit%
        ! mov bx, Stunde%
        ! mov cx, Minute%
        ! mov dx, Sekunde%
        ! xor ax, ax
        ! or  ax, bx
        ! or  ax, cx
        ! or  ax, dx
        ! mov DateiZeit%, ax

        ! push ds
        ! mov ax, &h3d90
        ! mov dx, DateiOff??
        ! mov ds, DateiSeg??
        ! int &h21
        ! pop ds
        ! mov DateiHandle%, ax
        ! jnc WriteFileOk
        EXIT FUNCTION

        WriteFileOk:
        ! mov ax, &h5701
        ! mov bx, DateiHandle%
        ! mov cx, DateiZeit%
        ! mov dx, DateiDatum%
        ! int &h21
        ! mov ax, &h3e00
        ! mov bx, DateiHandle%
        ! int &h21
END FUNCTION

Quote:
> Thanks in advance.
> Igor


Bye
                                      ----------------
                                         /
                                       /  h o m a s

                            PB & Sound: Let the dream come true ...

## CrossPoint v3.02 R ##



Wed, 10 Dec 1997 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Problem: Win 3.1 crashes with PB 3.1 programs

2. URGENT: Help with Sound PRogramming Under Windows 3.1

3. PB 3.1/3.2

4. FileCopy for PB 3.1

5. Raycasting for PB 3.1

6. ASM in PB 3.1

7. ASM in PB 3.1

8. Using WINAPI 3.1 call FindExecutable on Windows 3.1

9. Urgent Help required using access 8 objects from VB5

10. PLEASE HELP - MKS MKD etc - Urgent Help Required

11. HELP - MKS CVS MKD etc - Urgent Help Required

12. Netware 3.1 , Windows 3.1 and VB

 

 
Powered by phpBB® Forum Software