469,964 Members | 1,666 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

Read-only access to FAT32/NTFS files w/ write locks?

Hello,

In my application that I'm writing in C++ (and maybe Java),
specifically the cygwin flavor of C++, I want to be able to open any
existing files in FAT32 or NTFS file systems (in Windows XP) for
read-only purposes. In particular, I want my program to
unconditionally be able to read-only open any file--and be able to
read all the contents from said fail--which has been marked with any
sort of "exclusionary" lock, including write locks or any other kind
of locks.

Is this possible? Are there any "exclusionary" locks or scenarios
where in WinXP (with either FAT32 or NTFS files) that might prevent
another process from opening a file in read-only mode?

The only case I have experience: using cygwin to unset all file
permissions (including the "read" bit(s)) in an NTFS file system, in
which case non-Administrator processes (presumably) will not be able
to read the file.

Thanks for any help,
-Matt

--
Remove the "downwithspammers-" text to email me.
Jul 23 '05 #1
2 2826
Snapshots help a lot.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma***@storagecraft.com
http://www.storagecraft.com

"Matt" <ma**@downwithspammers-mengland.net> wrote in message
news:6b********************************@4ax.com...
Hello,

In my application that I'm writing in C++ (and maybe Java),
specifically the cygwin flavor of C++, I want to be able to open any
existing files in FAT32 or NTFS file systems (in Windows XP) for
read-only purposes. In particular, I want my program to
unconditionally be able to read-only open any file--and be able to
read all the contents from said fail--which has been marked with any
sort of "exclusionary" lock, including write locks or any other kind
of locks.

Is this possible? Are there any "exclusionary" locks or scenarios
where in WinXP (with either FAT32 or NTFS files) that might prevent
another process from opening a file in read-only mode?

The only case I have experience: using cygwin to unset all file
permissions (including the "read" bit(s)) in an NTFS file system, in
which case non-Administrator processes (presumably) will not be able
to read the file.

Thanks for any help,
-Matt

--
Remove the "downwithspammers-" text to email me.

Jul 23 '05 #2
Matt wrote:
[a Windows-specific question]

This is off-topic for clc++. Followups set.

Kristo

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Gunnar | last post: by
6 posts views Thread by Steve | last post: by
12 posts views Thread by Steven T. Hatton | last post: by
2 posts views Thread by Sandman | last post: by
4 posts views Thread by Andreas Müller | last post: by
4 posts views Thread by Ollie Cook | last post: by
8 posts views Thread by S Shulman | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.