Page 1 of 1

Cambiar atributos a archivos - Change attributes on files

Posted: Wed Feb 24, 2016 1:34 am
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?

Re: Cambiar atributos a archivos - Change attributes on files

Posted: Wed Feb 24, 2016 1:42 am
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

Re: Cambiar atributos a archivos - Change attributes on files

Posted: Wed Feb 24, 2016 4:09 am
by esgici

Re: Cambiar atributos a archivos - Change attributes on files

Posted: Wed Feb 24, 2016 4:37 pm
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)

Re: Cambiar atributos a archivos - Change attributes on files

Posted: Fri Feb 26, 2016 2:47 am
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