hey,
i wanted to see if these FAT attribute constant addresses are OK.
ATTR_READONLY =0x001
ATTR_SYSTEM =0x20
ATTR_HIDDEN =0x0002
memory addresses
memory addresses
oh microsoft, microsoft, what souls you have dismayed
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
This is what they should be:
Have you read the FAT doc from Microsoft? It has everything you need.
Code: Select all
#define ATTR_READ_ONLY 0x01
#define ATTR_HIDDEN 0x02
#define ATTR_SYSTEM 0x04
#define ATTR_VOLUME_ID 0x08
#define ATTR_DIRECTORY 0x10
#define ATTR_ARCHIVE 0x20
#define ATTR_LONG_NAME ( ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID )
#define ATTR_LONG_NAME_MASK ( ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID | ATTR_DIRECTORY | ATTR_ARCHIVE )
mayby same reason why i do it.xsix wrote:maybe OKay, maybe not, but why you've ripped the code? or you are really beginner. i just can't see the point of writing 0x000001 instead of 1 or 0x1. tell me WHY ?
0x01 - means byte domain (8 bits)
0x0001 - means word domain (16 bits)
0x00000001 - means dword domain (32 bits)
so your point of him being a real beginner is kind of sad, or better really dumb. People develop an own style of programming which is problably not like yours and maybe even better. Damn now i am in a ranting mode. so if you cannot make a useful remark... then DONT
end of rant.
Author of COBOS
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
In the context of FAT filesystems, though, it makes no sense to read/write anything but a byte. The attributes are one byte long, and there's no escaping that.
The other thing is, his values are correct, but extremely messy.
There is no pattern in the definitions, which makes this really hard to understand. The best practice is to use byte length where you need bytes, words when you need words and dwords when you need dwords. It's pointless (and a waste of time) to write in the extra 0s.
The other thing is, his values are correct, but extremely messy.
Code: Select all
#define ATTR_READONLY 0x001
#define ATTR_SYSTEM 0x20
#define ATTR_HIDDEN 0x0002
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Yes, but the shorter they are the easier they are to read, and aren't mistaken as longer integers.
In the end, it's not our place to tell people how to code. I just don't like seeing people waste time with small things (such as extra 0s).
Then again, this whole argument is wasting time over a small thing.
In the end, it's not our place to tell people how to code. I just don't like seeing people waste time with small things (such as extra 0s).
Then again, this whole argument is wasting time over a small thing.
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact: