Cambiar atributos a archivos - Change attributes on files

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
Alepts
Posts: 9
Joined: Thu Feb 18, 2016 5:01 am

Cambiar atributos a archivos - Change attributes on files

Post by Alepts »

Actualmente cambio los atributos mediante MS-DOS Run "ATTRIB &fName +R" pero al estar usando el entorno grafico no es estético ver aparecer una ventana negra. ¿hay otra forma de hacerlo?

I change the attribute file with MS-DOS Run "ATTRIB &fName +R" but it show a black window that i don't like. another method?
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Cambiar atributos a archivos - Change attributes on files

Post by andyglezl »

shellexecute(0,'open','Touch.exe','rest*.dbf /D '+V2S(DATE())+' /T '+TIME(),,0)

Pones 0 (cero) el ultimo parametro y no debe aparecer la ventana de DOS
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Cambiar atributos a archivos - Change attributes on files

Post by esgici »

Viva INTERNATIONAL HMG :D
Alepts
Posts: 9
Joined: Thu Feb 18, 2016 5:01 am

Re: Cambiar atributos a archivos - Change attributes on files

Post by Alepts »

Gracias, las 2 opciones me funcionaron

Thanks, the 2 options work fine

Code: Select all

shellexecute(0,'open','ATTRIB',' &fName +R',,0)

Code: Select all

SETFATTR(fName,1)
gvaronas
Posts: 109
Joined: Wed Aug 06, 2008 5:21 pm

Re: Cambiar atributos a archivos - Change attributes on files

Post by gvaronas »

Hola:
Tal vez una de estas funciones te pueda servir:

2014-02-25 19:34 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
. . .
* src/rtl/Makefile
+ src/rtl/xfile.c
+ added PRG interface to Harbour FILE IO API
The following PRG functions are available for Harbour programmers:
HB_VFEXISTS( <cFileName>, [ @<cDestFileName> ] ) -> <lOK>
HB_VFERASE( <cFileName> ) -> <nResult>
HB_VFRENAME( <cFileSrc>, <cFileDst> ) -> <nResult>
HB_VFCOPYFILE( <cFileSrc>, <cFileDst> ) -> <nResult>
HB_VFDIREXISTS( <cDirName> ) -> <lExists>
HB_VFDIRMAKE( <cDirName> ) -> <nSuccess>
HB_VFDIRREMOVE( <cDirName> ) -> <nSuccess>
HB_VFDIRECTORY( [ <cDirSpec> ], [ <cAttr> ] ) -> <aDirectory>
HB_VFDIRSPACE( <cDirName>, [ <nInfoType> ] ) -> <nFreeSpace>
HB_VFATTRGET( <cFileName>, @<nAttr> ) -> <lOK>
HB_VFATTRSET( <cFileName>, <nAttr> ) -> <lOK>
HB_VFTIMEGET( <cFileName>, @<tsDateTime> ) -> <lOK>
HB_VFTIMESET( <cFileName>, <tsDateTime> ) -> <lOK>
HB_VFLINK( <cExistingFileName>, <cNewFileName> ) -> <nSuccess>
HB_VFLINKSYM( <cTargetFileName>, <cNewFileName> ) -> <nSuccess>
HB_VFLINKREAD( <cFileName> ) -> <cDestFileName> | ""
HB_VFOPEN( <cFileName>, [ <nMode> ], [ <nAttr> ] ) -> <pHandle> | NIL
HB_VFCLOSE( <pHandle> ) -> <lOK>
HB_VFLOCK( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) -> <lOK>
HB_VFUNLOCK( <pHandle>, <nStart>, <nLen> ) -> <lOK>
HB_VFLOCKTEST( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) ;
-> <nPID> | 0 (nolock) | -1 (err)
HB_VFREAD( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nTimeOut> ] ) ;
-> <nRead>
HB_VFWRITE( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nTimeOut> ] ) ;
-> <nWritten>
HB_VFREADAT( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nAtOffset> ] ) ;
-> <nRead>
HB_VFWRITEAT( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nAtOffset> ] ) ;
-> <nWritten>
HB_VFSEEK( <pHandle>, <nOffset>, [ <nWhence> ] ) -> <nOffset>
HB_VFTRUNC( <pHandle>, [ <nAtOffset> ] ) -> <lOK>
HB_VFSIZE( <pHandle> ) -> <nSize>
HB_VFEOF( <pHandle> ) -> <lEOF>
HB_VFFLUSH( <pHandle>, [ <lDirtyOnly> ] ) -> NIL
HB_VFCOMMIT( <pHandle> ) -> NIL
HB_VFCONFIG( <pHandle>, <nSet>, [ <nParam> ] ) -> <nResult>
HB_VFHANDLE( <pHandle> ) -> <nOsHandle>
HB_VFTEMPFILE( @<cFileName>, [ <cDir> ], [ <cPrefix> ], [ <cExt> ], ;
[ <nAttr> ] ) -> <pHandle> | NIL
. . .

Especialmente estas:

HB_VFATTRGET( <cFileName>, @<nAttr> ) -> <lOK>
HB_VFATTRSET( <cFileName>, <nAttr> ) -> <lOK>

Aunque creo que han cambiado de nombre.

Salu2,
GVS
Post Reply