Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

SmurfnSurf

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

martin wrote:

For now, I've decided to simply ignore symlinks:
Issue 2365 – Skip symlinks in Search for Text extension
Will see if better solution is needed.


Thank you, really appreciate you following up on this.
SmurfnSurf

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

martin wrote:

Thanks. So it's a symlink with a relative path to a directory.
WinSCP has problems with resolving the relative path. I'll look into it.

OK Thank you for looking into it, much appreciated.

martin wrote:

  • It might work better with SFTP protocol (why are you using SCP?)

From memory I couldn't log in to the (ASUS RT-AX88U Pro)) Router using SFTP. See error.
SCP just worked, so I always use that.

martin wrote:

  • If you can, change the symlink to use an absolute path (/sys/kernel/debug).

I am not sure I can do that, I am not keen on changing anything in the Routers OS sorry, just not experienced enough.

martin wrote:

  • Exclude the /debug from the search by adding |/debug to the file mask.

OK, I can certainly do that thank you.
martin

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

Thanks. So it's a symlink with a relative path to a directory.
WinSCP has problems with resolving the relative path. I'll look into it.
Meanwhile, you can try one of these:

  • It might work better with SFTP protocol (why are you using SCP?).
  • If you can, change the symlink to use an absolute path (/sys/kernel/debug).
  • Exclude the /debug from the search by adding |/debug to the file mask.
SmurfnSurf

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

Sorry about that, steep learning curve!
Hopefully this is what you needed?
martin

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

Thanks. Though you have enabled logging for the main GUI session. I've asked for log from the extension.
Go to: https://winscp.net/eng/docs/ui_pref_commands
Select the extension and click Configure.
SmurfnSurf

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

See attached. I used Debug level 2.
I attach 3 logs, as the first one (Where I answered N to continue after the error, see picture) does not seem to have a lot, the other two more detail (I answered Y to continue and got a second error too).
martin

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

Please go to preferences and enable session logging for the extension:
https://winscp.net/eng/docs/ui_pref_commands
And post the log here.
Guest

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

Hi again,

You're correct; it is a directory (on an ASUS Rt-AX88U Pro Router).
See attached. HTH?
martin

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

No that's not where I'm heading. I believe it's a directory, not a file. Can you check?
SmurfnSurf

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

I’m pretty sure it’s a debug file generated by the router, so I think I see where you are going with the observation as it’s constantly growing/ being updated.

How do I exclude that file from the search?
martin

Re: Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

Is the /debug a file or a directory?
SmurfnSurf

Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access ... denied

Background: I use to have WinSCP Portable in C:\Utils\WinSCP, for many years.

I wanted to use the Search TEXT within files feature, via the built-in extension, so I installed WinSCP Windows Installer in Win11 "for everyone" and selected the custom install, to the C:\Utils\WinSCP dir, not the default dir.

I then ran the Commands > Static Custom Commands > Search for Text Extension.

PowerShell window comes up, searches, finds my text (simply QTPi4Eth in *.* from root on an Asus Router), continues 3 more lines then I get this error below (User Redacted to XXXXXX).

I have searched the forum but cannot find a similar instance that has been answered and solved. How can I help you troubleshoot this please?

File /data/boot_state_0 matches mask, searching contents...

File /data/scratchpad matches mask, searching contents...
File /debug matches mask, searching contents...
Select-String : The file C:\Users\XXXXXXX\AppData\Local\Temp\debug cannot be read: Access to the path
'C:\Users\XXXXXXX\AppData\Local\Temp\debug' is denied.
At C:\Utils\WinSCP\Extensions\SearchText.WinSCPextension.ps1:78 char:30
+ ...         $matchInfo = Select-String -Path $tempPath -SimpleMatch $text
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Select-String], ArgumentException
    + FullyQualifiedErrorId : ProcessingFile,Microsoft.PowerShell.Commands.SelectStringCommand

Confirm
The item at C:\Users\XXXXXXX\AppData\Local\Temp\debug has children and the Recurse parameter was not specified. If you
 continue, all children will be removed with the item. Are you sure you want to continue?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

Thank you!