* fhandler_netdrive.cc (fhandler_netdrive::telldir): Implement.
(fhandler_netdrive::seekdir): Implement. (fhandler_netdrive::closedir): Call rewinddir to have only one point of calling WNetCloseEnum.
This commit is contained in:
parent
f2b664e0dd
commit
bffaf54d76
|
@ -1,3 +1,10 @@
|
||||||
|
2005-05-18 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_netdrive.cc (fhandler_netdrive::telldir): Implement.
|
||||||
|
(fhandler_netdrive::seekdir): Implement.
|
||||||
|
(fhandler_netdrive::closedir): Call rewinddir to have only one point
|
||||||
|
of calling WNetCloseEnum.
|
||||||
|
|
||||||
2005-05-17 Corinna Vinschen <corinna@vinschen.de>
|
2005-05-17 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler.h (class fhandler_netdrive): Add method rewinddir.
|
* fhandler.h (class fhandler_netdrive): Add method rewinddir.
|
||||||
|
|
|
@ -212,12 +212,18 @@ fhandler_netdrive::readdir (DIR *dir)
|
||||||
_off64_t
|
_off64_t
|
||||||
fhandler_netdrive::telldir (DIR *dir)
|
fhandler_netdrive::telldir (DIR *dir)
|
||||||
{
|
{
|
||||||
return -1;
|
return dir->__d_position;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fhandler_netdrive::seekdir (DIR *, _off64_t)
|
fhandler_netdrive::seekdir (DIR *dir, _off64_t pos)
|
||||||
{
|
{
|
||||||
|
rewinddir (dir);
|
||||||
|
if (pos < 0)
|
||||||
|
return;
|
||||||
|
while (dir->__d_position < pos)
|
||||||
|
if (!readdir (dir))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -232,9 +238,7 @@ fhandler_netdrive::rewinddir (DIR *dir)
|
||||||
int
|
int
|
||||||
fhandler_netdrive::closedir (DIR *dir)
|
fhandler_netdrive::closedir (DIR *dir)
|
||||||
{
|
{
|
||||||
if (dir->__handle != INVALID_HANDLE_VALUE)
|
rewinddir (dir);
|
||||||
WNetCloseEnum (dir->__handle);
|
|
||||||
dir->__handle = INVALID_HANDLE_VALUE;
|
|
||||||
return fhandler_virtual::closedir (dir);
|
return fhandler_virtual::closedir (dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue