Hello,

RawFileIO is caching the file descriptors so that a file doesn't have
to be opened for every operation.  First it checks if the cached file
descriptor is already compatible with the open request, and only
re-opens the file if it is not.  This could happen if the file was
originally opened read-only and then later opened for write.  The
'old' file descriptor is no longer used at that point, but we don't
know if another thread is still using it.  So both file descriptors
are kept around until the file is closed.

If Windows does not allow a file to be renamed while the file is open,
then why do you need to work around it in encfs?  Once the user closes
an encfs file, then the underlying file is closed..

regards,
Valient


On Fri, Dec 10, 2010 at 7:05 AM, Frediano Ziglio <fredd...@gmail.com> wrote:
> Hi,
>  I'm currently porting encfs to Windows platform and I hope someone
> is interested and could help me.
>
> Currently I can initialize the directory, mount it, create, read and
> write files and directories. I just fixed rename operation and but I
> miss delete. The problem in rename/delete operation is windows
> locking. While in Unix you can delete/rename a file while it's open
> you can't do it in Windows. To fix rename problem I added a
> FileIO::rename operation which is implemented in RawFileIO closing
> file before and reopening before exiting if needed. However I don't
> know if this is correct and why the need for oldfd.. perhaps file
> descriptor is held by some other objects to you keep a read/only and a
> write descriptor always so to be sure descriptors are always valid ??
> If this is true my fix can cause problems.
>
> Regards
>  Frediano Ziglio
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Encfs-users mailing list
> Encfs-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/encfs-users
>

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Encfs-users mailing list
Encfs-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/encfs-users

Reply via email to