GETATTR

From MCS Wiki AVR
(Difference between revisions)
Jump to: navigation, search
(Created page with "= <span class="f_Header">Action</span> = Returns the file Attribute. <span style="font-family: Arial;"> </span> <span style="font-family: Arial;"> </span> = <spa...")
 
(Remarks)
 
(2 intermediate revisions by one user not shown)
Line 17: Line 17:
 
= <span class="f_Header">Remarks</span> =
 
= <span class="f_Header">Remarks</span> =
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
{| width="609" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
+
{| width="80%" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
 
| valign="top" width="19%" style="width: 150px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="19%" style="width: 150px; border: 1px solid rgb(0, 0, 0);" |  
Line 23: Line 23:
  
 
| valign="top" width="56%" style="width: 450px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="56%" style="width: 450px; border: 1px solid rgb(0, 0, 0);" |  
(Byte) File open mode, See table
+
Numeric variable which is assigned with the file attribute.
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
 
| valign="top" width="19%" style="width: 150px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="19%" style="width: 150px; border: 1px solid rgb(0, 0, 0);" |  
bFileNumber
+
sFile
 
+
| valign="top" width="56%" style="width: 450px; border: 1px solid rgb(0, 0, 0);" |
+
(Byte) Number of the opened file
+
  
 +
| valign="top" width="56%" style="width: 450px; border: 1px solid rgb(0, 0, 0);" | <div>The name of the file (no wildcard) to get the attribute from.</div><div>You may also omit the name in which case the file will be used previous found by the DIR() function.</div>
 
|}
 
|}
 
</div>
 
</div>
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
This functions returns information about the File open mode
+
This functions returns the DOS file attributes. A file can have multiple attributes.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
Line 45: Line 43:
 
<span style="font-weight: bold;">Return value</span>
 
<span style="font-weight: bold;">Return value</span>
  
| valign="top" width="68%" bgcolor="#ffff99" style="width: 83px; background-color: rgb(255, 255, 153); border: 1px solid rgb(0, 0, 0);" |  
+
| valign="top" width="68%" bgcolor="#ffff99" style="width: 122px; background-color: rgb(255, 255, 153); border: 1px solid rgb(0, 0, 0);" |  
<span style="font-weight: bold;">Open mode</span>
+
<span style="font-weight: bold;">DOS Attribute</span>
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 53: Line 51:
  
 
| valign="top" width="68%" style="width: 83px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="68%" style="width: 83px; border: 1px solid rgb(0, 0, 0);" |  
INPUT
+
Read Only
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
Line 60: Line 58:
  
 
| valign="top" width="68%" style="width: 83px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="68%" style="width: 83px; border: 1px solid rgb(0, 0, 0);" |  
OUTPUT
+
Hidden
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
 
| valign="top" width="59%" style="width: 122px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="59%" style="width: 122px; border: 1px solid rgb(0, 0, 0);" |  
8
+
4
  
 
| valign="top" width="68%" style="width: 83px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="68%" style="width: 83px; border: 1px solid rgb(0, 0, 0);" |  
APPEND
+
System File
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
 
| valign="top" width="59%" style="width: 122px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="59%" style="width: 122px; border: 1px solid rgb(0, 0, 0);" |  
32
+
8
  
 
| valign="top" width="68%" style="width: 83px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="68%" style="width: 83px; border: 1px solid rgb(0, 0, 0);" |  
BINARY
+
Volume Label
  
|}
 
</div>
 
<span style="font-family: Arial;">&nbsp;</span>
 
 
<span style="font-family: Arial;">&nbsp;</span>
 
 
= <span class="f_Header">See also</span> =
 
 
[[INITFILESYSTEM]] , [[OPEN]] , [[CLOSE]], [[FLUSH]] , [[PRINT]], [[LINE INPUT]], [[LOC]], [[LOF]] , [[EOF]] , [[FREEFILE]] , [[SEEK]] , [[BSAVE]] , [[BLOAD]] , [[KILL]] ,[[DISKFREE]] , [[DISKSIZE]] , [[GET]] , [[PUT]], [[FILEDATE]] , [[FILETIME]] , [[FILEDATETIME]] , [[DIR]] , [[FILELEN]], [[WRITE]] , [[INPUT]]
 
 
<span style="font-family: Arial;">&nbsp;</span>
 
 
<span style="font-family: Arial;">&nbsp;</span>
 
 
= <span class="f_Header">ASM</span> =
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
{| width="634" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
| valign="top" width="18%" style="width: 146px; border: 1px solid rgb(0, 0, 0);" |  
+
| valign="top" width="59%" style="width: 122px; border: 1px solid rgb(0, 0, 0);" |  
Calls
+
16
  
| valign="top" width="34%" style="width: 280px; border: 1px solid rgb(0, 0, 0);" |  
+
| valign="top" width="68%" style="width: 83px; border: 1px solid rgb(0, 0, 0);" |  
_FileAttr
+
Sub Directory
 
+
| valign="top" width="24%" style="width: 196px; border: 1px solid rgb(0, 0, 0);" |
+
<span style="font-family: Arial;">&nbsp;</span>
+
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
| valign="top" width="18%" style="width: 146px; border: 1px solid rgb(0, 0, 0);" |  
+
| valign="top" width="59%" style="width: 122px; border: 1px solid rgb(0, 0, 0);" |  
Input
+
32
  
| valign="top" width="34%" style="width: 280px; border: 1px solid rgb(0, 0, 0);" |  
+
| valign="top" width="68%" style="width: 83px; border: 1px solid rgb(0, 0, 0);" |  
r24: Filenumber
+
Archive
 
+
| valign="top" width="24%" style="width: 196px; border: 1px solid rgb(0, 0, 0);" |
+
<span style="font-family: Arial;">&nbsp;</span>
+
  
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
| valign="top" width="18%" style="width: 146px; border: 1px solid rgb(0, 0, 0);" |  
+
| valign="top" width="59%" style="width: 122px; border: 1px solid rgb(0, 0, 0);" |  
Output
+
64,128
  
| valign="top" width="34%" style="width: 280px; border: 1px solid rgb(0, 0, 0);" |  
+
| valign="top" width="68%" style="width: 83px; border: 1px solid rgb(0, 0, 0);" |  
24: File open mode
+
Reserved
 
+
|}
| valign="top" width="24%" style="width: 196px; border: 1px solid rgb(0, 0, 0);" |
+
</div>
r25: Errorcode
+
 
+
|- style="vertical-align: top;"
+
| valign="top" width="18%" style="width: 146px; border: 1px solid rgb(0, 0, 0);" |
+
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
| valign="top" width="34%" style="width: 280px; border: 1px solid rgb(0, 0, 0);" |
 
C-Flag: Set on Error
 
 
| valign="top" width="24%" style="width: 196px; border: 1px solid rgb(0, 0, 0);" |
 
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
 +
A file could have an attribute of 3 (hidden+ read only)
  
|}
+
= <span class="f_Header">See also</span> =
</div>
+
<span style="font-family: Arial;">&nbsp;</span>
+
  
<span style="font-family: Arial;">&nbsp;</span>
+
[[INITFILESYSTEM]] , [[OPEN]] , [[CLOSE]], [[FLUSH]] , [[PRINT]], [[LINE INPUT]], [[LOC]], [[LOF]] , [[EOF]] , [[FREEFILE]] , [[SEEK]] , [[BSAVE]] , [[BLOAD]] , [[KILL]] ,[[DISKFREE]] , [[DISKSIZE]] , [[GET]] , [[PUT]], [[FILEDATE]] , [[FILETIME]] , [[FILEDATETIME]] , [[DIR]] , [[FILELEN]], [[WRITE]] , [[INPUT]]
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Partial Example</span> =
+
= <span style="font-size: 14pt; font-weight: bold;">Partial Example</span> =
  
 
<br/><source lang="bascomavr">
 
<br/><source lang="bascomavr">

Latest revision as of 23:04, 21 November 2014

Contents

Action

Returns the file Attribute.

 

 

Syntax

bFileAttribut = GETATTR([sFile])

 

 

Remarks

bFileAttribut

Numeric variable which is assigned with the file attribute.

sFile

The name of the file (no wildcard) to get the attribute from.
You may also omit the name in which case the file will be used previous found by the DIR() function.

 

This functions returns the DOS file attributes. A file can have multiple attributes.

 

Return value

DOS Attribute

1

Read Only

2

Hidden

4

System File

8

Volume Label

16

Sub Directory

32

Archive

64,128

Reserved

 

  A file could have an attribute of 3 (hidden+ read only)

See also

INITFILESYSTEM , OPEN , CLOSE, FLUSH , PRINT, LINE INPUT, LOC, LOF , EOF , FREEFILE , SEEK , BSAVE , BLOAD , KILL ,DISKFREE , DISKSIZE , GET , PUT, FILEDATE , FILETIME , FILEDATETIME , DIR , FILELEN, WRITE , INPUT

 

Partial Example


'open the file in BINARY mode
Print Getattr("somefile.bin")

Languages   English  
Personal tools
Namespaces
Variants
Actions
Navigation
Language