Hello Jayadev,
Try my code delow my sinature :
Bernard
// begin code
* Test.prg - Programme de test.
* -----------------------------
*
/*
*/
/* File attributes flags (in
fileio.ch) */
#define HB_FA_ALL 0x00000000
#define HB_FA_READONLY 0x00000001 /* R */
#define HB_FA_HIDDEN 0x00000002 /* H */
#define HB_FA_SYSTEM 0x00000004 /* S */
#define HB_FA_LABEL 0x00000008 /* V */
#define HB_FA_DIRECTORY 0x00000010 /* D | S_ISDIR() */
#define HB_FA_ARCHIVE 0x00000020 /* A | S_ISREG() */
#define HB_FA_DEVICE 0x00000040 /* I | S_ISBLK() */
#define HB_FA_NORMAL 0x00000080 /* */
#define HB_FA_TEMPORARY 0x00000100 /* T | S_ISFIFO()??? */
#define HB_FA_SPARSE 0x00000200 /* P | S_ISSOCK()??? */
#define HB_FA_REPARSE 0x00000400 /* L | S_ISLNK() */
#define HB_FA_COMPRESSED 0x00000800 /* C | S_ISCHR()??? */
#define HB_FA_OFFLINE 0x00001000 /* O */
#define HB_FA_NOTINDEXED 0x00002000 /* X */
#define HB_FA_ENCRYPTED 0x00004000 /* E */
#define HB_FA_VOLCOMP 0x00008000 /* M volume supports
compression. */
*
* --------------
PROCEDURE Main
* --------------
*
* TODO : variables MEMVAR.
* TODO : variables LOCAL.
*
LOCAL cFile := "Test.txt"
*
SET DATE FRENCH
*
* Mise en ANSI (Windows) langue française.
*
REQUEST HB_LANG_FR
REQUEST HB_CODEPAGE_FRWIN
HB_CDPSELECT('FRWIN')
HB_LANGSELECT('FR')
*
SETMODE( 43, 80 ) && Lignes et
colonnes d'affichage écran.
*
? IsReadOnly( cFile )
*
?
?
WAIT
*
RETURN
*
* --------------------------------------
FUNCTION IsReadOnly( cFile )
* --------------------------------------
*
LOCAL nAttrib
*
hb_FGetAttr( cFile, @nAttrib )
*
IF MOD( nAttrib, 2 ) == 1
RETURN .T.
ENDIF
*
RETURN .F.
// end code
On 22 août, 14:26, "
ujayadev_at_gmail.com" <
ujaya...@gmail.com> wrote:
> Dear Bernard,
>
> Many thanks for your pointer. What I was looking for is as to how to check
> the attribute of one file which needs to be opened. Maybe it requires some
> C function. Pls see directory() C function for example.
>
> I would like to request a function such as IsReadOnly(cFileName) if
> possible.
>
> Warm regards,
>
> Jayadev
>
>
>
> On Wednesday, August 22, 2012 5:29:53 PM UTC+5:30, Bernard Mouille wrote:
>
> > Hello Jayadev,
>
> > Look home Giovani Di Maria : ADIR() function :
>
> >
http://www.elektrosoft.it/tutorials/Harbour-Reference-Guide/harbour-r...