Caching returning wrong directory, can I turn it off?

Advertisement

Will.Turner
Guest

Caching returning wrong directory, can I turn it off?

I am using WinSCP scripting to upload files to the same server, but different folders. I use separate scripts for this. I call these at least twice an hour. It looks like the directory caching is failing and it is causing the files to not be uploaded properly. One script I am attempting to change the directory to ...eaimages and it looks like it is changing it to ...mfimages. mfimages is used in the other script and I don't know how/why it is popping up here.

See the log below:
2014-06-03 12:51:30.382 Script: cd /public_ftp/eaimages
2014-06-03 12:51:30.382 Cached directory change via "/public_ftp/eaimages" to "//PWD/public_ftp/mfimages=//PWD/=//PWD"/.
2014-06-03 12:51:30.382 Getting current directory name.
2014-06-03 12:51:30.382 Script: //PWD/public_ftp/mfimages=//PWD/=//PWD
2014-06-03 12:51:30.383 Script: put "C:\....."
2014-06-03 12:51:30.383 Copying 1 files/directories to remote directory "//PWD/public_ftp/mfimages=//PWD/=//PWD"
It then attempts to upload the files to the wrong directory, but from what I can see – the file goes into the void. It never shows up anywhere even though it spends time sending it.

I use the /public_ftp/mfimages in another script so I can see why it is caching. I just think there is a bug and I don't want to mess with it. I just want to turn off caching for now and get this working again.

Reply with quote

Advertisement

Will.Turner
Guest

Well, I found the missing files that it is uploading.

The are being put into this folder:
/PWD/public_ftp/mfimages=/PWD/=/PWD
This is crazy.

I tried turning off directory caching in the graphical interface like the docs say I can do and it had no effect.

The logs still say it is using cache and permanent cache

Reply with quote

PlanetIrata
Guest

Same problem here with wrong //PWD cached directory

I experience the same //PWD issue with WinSCP 5.5.3 (build 4214), here is my log when I try to change the current directory to yann and delete the about.html file in this directory just after the session opening:
> 2016-10-27 17:19:56.923 Script: cd yann
. 2016-10-27 17:19:56.923 Cached directory change via "yann" to "//PWD".
. 2016-10-27 17:19:56.923 Getting current directory name.
< 2016-10-27 17:19:56.923 Script: //PWD
> 2016-10-27 17:19:56.924 Script: rm about.html
. 2016-10-27 17:19:56.924 Listing file "about.html".
. 2016-10-27 17:19:56.924 Retrieving directory listing...
> 2016-10-27 17:19:56.924 CWD /PWD/
< 2016-10-27 17:19:56.939 550 /PWD/: No such file or directory
. 2016-10-27 17:19:56.939 Could not retrieve directory listing
. 2016-10-27 17:19:56.939 LIST with -a failed, walling back to pure LIST
. 2016-10-27 17:19:56.939 Retrieving directory listing...
> 2016-10-27 17:19:56.939 CWD /PWD/
< 2016-10-27 17:19:56.950 550 /PWD/: No such file or directory
. 2016-10-27 17:19:56.950 Could not retrieve directory listing
< 2016-10-27 17:19:56.951 Script: Can't get attributes of file 'about.html'.
< 2016-10-27 17:19:56.951 Script: Could not retrieve directory listing
Obviously, the problem is with the cached directory change via yann to //PWD

I can't explain the problem, an I'd like to know if there is an option to disable caching while scripting (I use winscp.com). I see the /rawsetting parameter, but in the winscp.ini file, the CacheDirectories and CacheDirectoryChanges are [Sessions/xxxx] parameters, and not [Configuration/xxx] parameters.

So the caching seems impossible to disable...the best way would be to delete the cache from the hard drive before running my script, but I can't figure out where it is stored ? I'll investigate to find and delete the cache, but in the next release of WinSCP, could you add a script command to clear the cached directories? It could also be a new option parameter (option cachedir on|off) for instance.

Thanks.

Reply with quote

PlanetIrata
Guest

[Solved] Same problem here with wrong //PWD cached directory

For anyone interested, I find that the cached directories are stored in the [Configuration\CDCache] entry of the winscp.ini file. I now just empty the section before starting my script, and it works. Anyway, if we could disable this with a new option command value like suggested in my previous post, it would be easier to address.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum