PDA

View Full Version : PWD Command?


flashfxp-friend
06-04-2008, 10:00 AM
Hello

After each CWD (Change Working Directory) command, FlashFXP sends the PWD (Print Working Directory) command
The question is: why?

I don't know, maybe it's a standard or something, but I've never encountered with a situation when it was helpful
So I suggest you to add an option to turn off PWD command sending after CWD

Thx for the attention

MxxCon
06-04-2008, 04:44 PM
bad suggestion.
just because you "CD" somewhere, doesn't mean this is where you'll end up. server can redirect you anywhere it wants to. or for that matter not to allow you to go anywhere.
flashfxp needs to exactly know where it is after each directory change.

flashfxp-friend
06-05-2008, 04:22 AM
But it tells you the current directory right after CWD
example:

[R] CWD /
[R] 250 OK. Current directory is /
[R] PWD
[R] 257 "/" is your current location

[R] CWD access-logs
[R] 250 OK. Current directory is /access-logs
[R] PWD
[R] 257 "/access-logs" is your current location

[R] CWD /not-exist
[R] 550 Can't change directory to /not-exist: No such file or directory

Again, maybe it's not supposed to tell the current directory, and not every server returns it after CWD, but PWD can be disabled for servers that do

Edit:

Yep, seems like not all servers return the current directory after CWD
Lycos for example:

[R] CWD /html
[R] 250 CWD command successful
[R] PWD
[R] 257 "/html" is current directory.

So here I agree that PWD is necessary, but mostly it does not

DayCuts
06-05-2008, 05:38 AM
iirc (which i am admittidy not confident of) but the rfc's do not require that a cwd-response return anything useful with the numeric. such data is questionably useless anyway. the numerics themself are only required to indicate the success or failure of the command.

I am not sure of the rfc information regarding pwd, but since a cwd-response only requires the success or failure numerics be returned regardless of where you might end up upon a success, it is logical that a pwd and response should follow a successful cwd command.

Should also note that although many servers provide a little more than success/failure numerics, the fact that it is not a required return means that there is no standard to the response making it unreliable.

flashfxp-friend
06-05-2008, 06:40 AM
Yes, and I agree that removing the PWD call completely is wrong
But what I suggest is letting the user an option to do so for particular servers

For example you could add a pre-server option like that:
[v] Server returns current directory with CWD
Format: [_____________________________] (%cd% is the current directory)

And then for this server:
[R] CWD access-logs
[R] 250 OK. Current directory is /access-logs
[R] PWD
[R] 257 "/access-logs" is your current location

I would fill:
[v] Server returns current directory with CWD
Format: ["%cd%" is your current location] (%cd% is the current directory)

Would be very useful