[jcifs] Calling length on open file chokes
Allen, Michael B (RSCH)
Michael_B_Allen at ml.com
Fri Dec 14 11:35:33 EST 2001
Mmm. I thought this would go away with the shareAccess change in SmbComNTCreateAndX. Unfourtunately this particular file is opened by the Win32 Kernel which I guess uses a very restrictive
ShareAccess. The SMB_COM_QUERY_INFORMATION command is correctly getting the "File is being accessed by another process". smbclient uses the Trans2FindFirst2/Next2 commands. I'll see if there's a way
to handle this a little more elegantly but I don't think so. Technically the "file is being accessed by another processes" business is correct; you shouldn't be querying that file. This is another yet
another reason to implement listFiles().
Mike
> -----Original Message-----
> From: Rob Wygand [SMTP:rob at filefish.com]
> Sent: Thursday, December 13, 2001 6:35 PM
> To: jcifs at samba.org
> Subject: [jcifs] Calling length on open file chokes
>
> Mike,
>
> Another little oddity, and this was also in 0.5.
>
> If I can length() is a file that is open by another process, I get an
> exception (the file is in use by another process). I see this all the
> time when 'browsing' pagefile.sys. It should be possible to read the
> attrs of a file, even if another process has a write lock on it, no?
>
> I tested this with smbclient, and that returns the right file length...
>
> rjw
>
>
More information about the jcifs
mailing list