Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using READDIRPLUS #2

Closed
roman-himmelreich-sp opened this issue Nov 12, 2015 · 7 comments
Closed

Using READDIRPLUS #2

roman-himmelreich-sp opened this issue Nov 12, 2015 · 7 comments

Comments

@roman-himmelreich-sp
Copy link
Collaborator

Hi,
There are two functions which list folder items: READDIR and READDIRPLUS Basically, READDIR only returns paths, READDIRPLUS returnes all other attributes.
When calling READDIRPLUS, there are two extra paramters that I can't understand how to use:

dircount
The maximum number of bytes of directory information to be returned. This number does not include the size of the attributes and file handle portions of the result.
maxcount
The maximum size of the READDIRPLUS3resok structure, in bytes. The size must include all XDR overhead. The server may return fewer than maxcount bytes of data.

No matter what I try, I can't seem to get it right.
Did anybody ever call this function succesfully?

@DeCoRawr
Copy link
Owner

Hi,

well it's been 2 years from active delevoplent of the client.

Why do you need the READDIRPLUS implementation ?

I rly don't remember what are the correct attributes now.

2015-11-12 17:42 GMT+01:00 roman-himmelreich-sp notifications@github.com:

Hi,
There are two functions which list folder items: READDIR and READDIRPLUS
Basically, READDIR only returns paths, READDIRPLUS returnes all other
attributes.
When calling READDIRPLUS, there are two extra paramters that I can't
understand how to use:

dircount
The maximum number of bytes of directory information to be returned. This
number does not include the size of the attributes and file handle portions
of the result.
maxcount
The maximum size of the READDIRPLUS3resok structure, in bytes. The size
must include all XDR overhead. The server may return fewer than maxcount
bytes of data.

No matter what I try, I can't seem to get it right.
Did anybody ever call this function succesfully?


Reply to this email directly or view it on GitHub
#2.

@roman-himmelreich-sp
Copy link
Collaborator Author

Hi,

thank you for your reply.

I need ReadDirPlus because we are building a Crawler for NFS.
Using ReadDir we would need to send a seperate request per item - to find out if its a folder/file and get the other attributes.
ReadDirPlus gets the list of items with the attributes in a single call.

I see there is an implementation for it, but you did not use it in the client.
The problem seems to be in the decoding and reading of the reply of ReadDirPlus. It returns OK and then somewhere during the XDR parsing of FolderEntry it fails.

If you could point me to where I can find the exact structure of the result that FolderEntry is trying to parse, maybe I can get it working.
I've tried comparing the parsing to the native libnfs code, but there they work with structs, the xdrDecoding is different because we need to know the order of the fields, as I understand...

thanks for any help in advance!
Roman.

Sent from BlueMail

On Nov 12, 2015, 8:19 PM, at 8:19 PM, DeCoRawr notifications@github.com wrote:

Hi,

well it's been 2 years from active delevoplent of the client.

Why do you need the READDIRPLUS implementation ?

I rly don't remember what are the correct attributes now.

2015-11-12 17:42 GMT+01:00 roman-himmelreich-sp
notifications@github.com:

Hi,
There are two functions which list folder items: READDIR and
READDIRPLUS
Basically, READDIR only returns paths, READDIRPLUS returnes all other
attributes.
When calling READDIRPLUS, there are two extra paramters that I can't
understand how to use:

dircount
The maximum number of bytes of directory information to be returned.
This
number does not include the size of the attributes and file handle
portions
of the result.
maxcount
The maximum size of the READDIRPLUS3resok structure, in bytes. The
size
must include all XDR overhead. The server may return fewer than
maxcount
bytes of data.

No matter what I try, I can't seem to get it right.
Did anybody ever call this function succesfully?


Reply to this email directly or view it on GitHub
#2.


Reply to this email directly or view it on GitHub:
#2 (comment)

@roman-himmelreich-sp
Copy link
Collaborator Author

Hi,

Eventually I found the problem,

You were missing one Boolean read from the XDR stream

and then the other read attempts were out of sync and everything failed.

READDIRPLUS gives you the contents of a folder with item attributes - in one call.

thanks for the source, it was really helpful!


From: DeCoRawr notifications@github.com
Sent: Thursday, November 12, 2015 8:19 PM
To: DeCoRawr/NFSClient
Cc: Roman Himmelreich
Subject: Re: [NFSClient] Using READDIRPLUS (#2)

Hi,

well it's been 2 years from active delevoplent of the client.

Why do you need the READDIRPLUS implementation ?

I rly don't remember what are the correct attributes now.

2015-11-12 17:42 GMT+01:00 roman-himmelreich-sp notifications@github.com:

Hi,
There are two functions which list folder items: READDIR and READDIRPLUS
Basically, READDIR only returns paths, READDIRPLUS returnes all other
attributes.
When calling READDIRPLUS, there are two extra paramters that I can't
understand how to use:

dircount
The maximum number of bytes of directory information to be returned. This
number does not include the size of the attributes and file handle portions
of the result.
maxcount
The maximum size of the READDIRPLUS3resok structure, in bytes. The size
must include all XDR overhead. The server may return fewer than maxcount
bytes of data.

No matter what I try, I can't seem to get it right.
Did anybody ever call this function succesfully?

Reply to this email directly or view it on GitHub
#2.

Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-156189553.

@DeCoRawr
Copy link
Owner

DeCoRawr commented Dec 8, 2015

uf i totaly forgot about this. :S

could you tell me where was this boolean missing ?

2015-12-08 18:11 GMT+01:00 roman-himmelreich-sp notifications@github.com:

Hi,

Eventually I found the problem,

You were missing one Boolean read from the XDR stream

and then the other read attempts were out of sync and everything failed.

READDIRPLUS gives you the contents of a folder with item attributes - in
one call.

thanks for the source, it was really helpful!


From: DeCoRawr notifications@github.com
Sent: Thursday, November 12, 2015 8:19 PM
To: DeCoRawr/NFSClient
Cc: Roman Himmelreich
Subject: Re: [NFSClient] Using READDIRPLUS (#2)

Hi,

well it's been 2 years from active delevoplent of the client.

Why do you need the READDIRPLUS implementation ?

I rly don't remember what are the correct attributes now.

2015-11-12 17:42 GMT+01:00 roman-himmelreich-sp <notifications@github.com

:

Hi,
There are two functions which list folder items: READDIR and READDIRPLUS
Basically, READDIR only returns paths, READDIRPLUS returnes all other
attributes.
When calling READDIRPLUS, there are two extra paramters that I can't
understand how to use:

dircount
The maximum number of bytes of directory information to be returned. This
number does not include the size of the attributes and file handle
portions
of the result.
maxcount
The maximum size of the READDIRPLUS3resok structure, in bytes. The size
must include all XDR overhead. The server may return fewer than maxcount
bytes of data.

No matter what I try, I can't seem to get it right.
Did anybody ever call this function succesfully?

Reply to this email directly or view it on GitHub
#2.

Reply to this email directly or view it on GitHub<
https://github.com/DeCoRawr/NFSClient/issues/2#issuecomment-156189553>.


Reply to this email directly or view it on GitHub
#2 (comment).

@roman-himmelreich-sp
Copy link
Collaborator Author

Sure!
I will send it to you once I'm n front of it...

On Dec 8, 2015, 7:35 PM, at 7:35 PM, DeCoRawr notifications@github.com wrote:

uf i totaly forgot about this. :S

could you tell me where was this boolean missing ?

2015-12-08 18:11 GMT+01:00 roman-himmelreich-sp
notifications@github.com:

Hi,

Eventually I found the problem,

You were missing one Boolean read from the XDR stream

and then the other read attempts were out of sync and everything
failed.

READDIRPLUS gives you the contents of a folder with item attributes -
in
one call.

thanks for the source, it was really helpful!


From: DeCoRawr notifications@github.com
Sent: Thursday, November 12, 2015 8:19 PM
To: DeCoRawr/NFSClient
Cc: Roman Himmelreich
Subject: Re: [NFSClient] Using READDIRPLUS (#2)

Hi,

well it's been 2 years from active delevoplent of the client.

Why do you need the READDIRPLUS implementation ?

I rly don't remember what are the correct attributes now.

2015-11-12 17:42 GMT+01:00 roman-himmelreich-sp
<notifications@github.com

:

Hi,
There are two functions which list folder items: READDIR and
READDIRPLUS
Basically, READDIR only returns paths, READDIRPLUS returnes all
other
attributes.
When calling READDIRPLUS, there are two extra paramters that I
can't
understand how to use:

dircount
The maximum number of bytes of directory information to be
returned. This
number does not include the size of the attributes and file handle
portions
of the result.
maxcount
The maximum size of the READDIRPLUS3resok structure, in bytes. The
size
must include all XDR overhead. The server may return fewer than
maxcount
bytes of data.

No matter what I try, I can't seem to get it right.
Did anybody ever call this function succesfully?

Reply to this email directly or view it on GitHub
#2.

Reply to this email directly or view it on GitHub<

https://github.com/DeCoRawr/NFSClient/issues/2#issuecomment-156189553>.


Reply to this email directly or view it on GitHub

#2 (comment).


Reply to this email directly or view it on GitHub:
#2 (comment)

@roman-himmelreich-sp
Copy link
Collaborator Author

Hi,

I made a few changes to make the MainForm work with READDIR_PLUS too

so it doesn't need to issue a seperate request for the attributes of each file

I would like to push the changes to git so you can see them

but I have no permissions

how does this work? is there some way I can publish this for you to see?

From: DeCoRawr notifications@github.com

Sent: Tuesday, December 8, 2015 7:35 PM
To: DeCoRawr/NFSClient
Cc: Roman Himmelreich
Subject: Re: [NFSClient] Using READDIRPLUS (#2)

uf i totaly forgot about this. :S

could you tell me where was this boolean missing ?

2015-12-08 18:11 GMT+01:00 roman-himmelreich-sp notifications@github.com:

Hi,

Eventually I found the problem,

You were missing one Boolean read from the XDR stream

and then the other read attempts were out of sync and everything failed.

READDIRPLUS gives you the contents of a folder with item attributes - in
one call.

thanks for the source, it was really helpful!


From: DeCoRawr notifications@github.com
Sent: Thursday, November 12, 2015 8:19 PM
To: DeCoRawr/NFSClient
Cc: Roman Himmelreich
Subject: Re: [NFSClient] Using READDIRPLUS (#2)

Hi,

well it's been 2 years from active delevoplent of the client.

Why do you need the READDIRPLUS implementation ?

I rly don't remember what are the correct attributes now.

2015-11-12 17:42 GMT+01:00 roman-himmelreich-sp <notifications@github.com

:

Hi,
There are two functions which list folder items: READDIR and READDIRPLUS
Basically, READDIR only returns paths, READDIRPLUS returnes all other
attributes.
When calling READDIRPLUS, there are two extra paramters that I can't
understand how to use:

dircount
The maximum number of bytes of directory information to be returned. This
number does not include the size of the attributes and file handle
portions
of the result.
maxcount
The maximum size of the READDIRPLUS3resok structure, in bytes. The size
must include all XDR overhead. The server may return fewer than maxcount
bytes of data.

No matter what I try, I can't seem to get it right.
Did anybody ever call this function succesfully?

Reply to this email directly or view it on GitHub
#2.

Reply to this email directly or view it on GitHub<
https://github.com/DeCoRawr/NFSClient/issues/2#issuecomment-156189553>.

Reply to this email directly or view it on GitHub
#2 (comment).

Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-162955175.

@DeCoRawr
Copy link
Owner

DeCoRawr commented Jan 9, 2016

I added you as contributor so you can push the changes now.

Thanks for everything.

DeCoRawr

2015-12-27 9:53 GMT+01:00 roman-himmelreich-sp notifications@github.com:

Hi,

I made a few changes to make the MainForm work with READDIR_PLUS too

so it doesn't need to issue a seperate request for the attributes of each
file

I would like to push the changes to git so you can see them

but I have no permissions

how does this work? is there some way I can publish this for you to see?

From: DeCoRawr notifications@github.com

Sent: Tuesday, December 8, 2015 7:35 PM
To: DeCoRawr/NFSClient
Cc: Roman Himmelreich
Subject: Re: [NFSClient] Using READDIRPLUS (#2)

uf i totaly forgot about this. :S

could you tell me where was this boolean missing ?

2015-12-08 18:11 GMT+01:00 roman-himmelreich-sp <notifications@github.com

:

Hi,

Eventually I found the problem,

You were missing one Boolean read from the XDR stream

and then the other read attempts were out of sync and everything failed.

READDIRPLUS gives you the contents of a folder with item attributes - in
one call.

thanks for the source, it was really helpful!


From: DeCoRawr notifications@github.com
Sent: Thursday, November 12, 2015 8:19 PM
To: DeCoRawr/NFSClient
Cc: Roman Himmelreich
Subject: Re: [NFSClient] Using READDIRPLUS (#2)

Hi,

well it's been 2 years from active delevoplent of the client.

Why do you need the READDIRPLUS implementation ?

I rly don't remember what are the correct attributes now.

2015-11-12 17:42 GMT+01:00 roman-himmelreich-sp <
notifications@github.com

:

Hi,
There are two functions which list folder items: READDIR and
READDIRPLUS
Basically, READDIR only returns paths, READDIRPLUS returnes all other
attributes.
When calling READDIRPLUS, there are two extra paramters that I can't
understand how to use:

dircount
The maximum number of bytes of directory information to be returned.
This
number does not include the size of the attributes and file handle
portions
of the result.
maxcount
The maximum size of the READDIRPLUS3resok structure, in bytes. The size
must include all XDR overhead. The server may return fewer than
maxcount
bytes of data.

No matter what I try, I can't seem to get it right.
Did anybody ever call this function succesfully?

Reply to this email directly or view it on GitHub
#2.

Reply to this email directly or view it on GitHub<
https://github.com/DeCoRawr/NFSClient/issues/2#issuecomment-156189553>.

Reply to this email directly or view it on GitHub
#2 (comment).

Reply to this email directly or view it on GitHub<
https://github.com/DeCoRawr/NFSClient/issues/2#issuecomment-162955175>.


Reply to this email directly or view it on GitHub
#2 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants