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

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

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
 
Matt said:
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

Windows has several mechanisms that will prevent you from
opening a file, either in read-only mode or in read/write mode.
The file could be locked (e.g. the paging file, or the registry
files), or the current account could have insufficient access
rights to that file. This is so by design.
 
Matt wrote:
[a Windows-specific question]

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

Kristo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Your XP mybe a Fat32 13
Converting from FAT32 to NTFS 3
FAT32 >>> NTFS 12
Partition Size Limit for Fat32 14
NTFS vs FAT32 7
FAT32 to NTFS & backup restore 12
NTFS vs FAT32 on WinXP Home 7
convert fat32 to ntfs 1

Back
Top