[AD] patch for windows NTFS file attributes

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Allegro doesn't play nice with NTFS extended file permissions (attributes).

Allegro's file_select() doesn't see all of my files. At first I thought it
was due to my network drives, so I ignored it. I decided to look into it
today and saw that it is actually because it will not pick up on non-indexed
files.

I looked at the source and saw that there is already a work around for
compressed files ... it needs to be extended to include more.

The patch I included looks really ugly to me, but I don't know how else it
would be done without any major rework. Basically I just want something that
works so when I use an Allegro game / util (like the Grabber), I can get
files off of my file server. :)

On a related note, would it be possible to have Allegro use the common file
selector under Windows if you are in a windowed mode? It's a simple API call
that accepts both flags and filters, and it shouldn't be that hard to
implement. I know the programmer could do it himself on a per game basis,
but the Allegro file selector is very annoying to use under Windows if you
store things on the desktop or in your personal folders. I cannot think of a
reason why anyone under Windows in a windowed game would prefer the Allegro
file selector, but perhaps a valid one does exist?

--
Matthew Leverton - matthew@xxxxxxxxxx
http://www.allegro.cc

----------
For referance:


FA_TEMPORARY   0x0100
I'm not sure what this flag means.

FA_SPARSE_FILE  0x0200
I believe this means that the file contains large blocks of zero, and that
NTFS will not physically store the excess zeros.

FA_REPARSE_POINT 0x0400
Reparse points are new in NTFS5 and they allow for various dynamic
extensions. For example, they can be used to create a Unix like symbolic
link.  See http://www.pcguide.com/ref/hdd/file/ntfs/filesReparse-c.html for
more info. I don't think that we'd want allegro to open these types of files
by default ... unless opening them actually opened a real file. Not sure,
but it wouldn't be a likely scenario for most people anyway.

FA_COMPRESSED  0x0800
File is compressed - should be included.

FA_OFFLINE  0x1000
I think this means the file is technically offline, but windows has copied
it to a local drive so you can access it.

FA_NOT_CONTENT_INDEXED   0x2000
Not indexed will be very common if people (like me) shut off the NTFS
indexer that provides a quick 'search in file' routine.

FA_ENCRYPTED 0x4000
Encrypted isn't as common, but it's still a valid file.



Attachment: ntfs_file.diff
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/