Problem reading cosmosDB files in VS code due to : in filename - visual-studio-code

I am storing integration logs in CosmosDB which have a timestamp in the filename including a ":" character. I'm not able to open the files in VS code because of this (and maybe the "." character as well). I found a github issue talking about this, but that issue is closed and I'm still not able to open the files. Need some guidance on what I can do to open this files from inside VS code. Yes, I could change the filename but I'd prefer just to make it work. I can open fine in the Azure Portal.
Example file name: 2019-09-04T14:38:35.308Z
Error message: "ENOENT:no such file or directory"

It seems this is a limitation based on allowable Windows filenames, so the option is either to rename the file or accept that I cannot read this files within VS Code and use Azure Storage Explorer instead.
I'm happy to accept a different answer if anyone out there has any other options!

Related

PhpStorm Formatter failed to format the document

Similar questions have been asked, but what makes mine different is that I seem to have the configuration correct. Here is my configuration (my name has been redacted, for privacy reasons).
What I know is that my PhpStorm IDE has not been activated yet; is that required or is my configuration incorrect, despite the folder and file being at these places?
So you're trying to use PhpStorm from within VSCode to format your files. Which means: calling PhpStorm as a command-line app.
I'm pretty sure that PhpStorm has to have a valid active licence or be in the evaluation period (so it has be "activated" in some way). I remember seeing tickets with similar issue when using PhpStorm for code inspections in Continuous Integration tools.
In any case:
Check what command VSCode is trying to execute here, then open your OS console and try to run it there -- will you see any errors/warnings in the output?
If you do not see any such messages there then check the idea.log file -- the IDE will write everything there for sure.
On Windows it would normally be in the C:\Users\USERNAME\AppData\Local\JetBrains\PhpStorm2022.2\log folder (for the current 2022.2 version). Other OS / cusom location -- check https://www.jetbrains.com/help/phpstorm/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#logs-directory
...or is my configuration incorrect, despite the folder and file being at these places?
As per docs the Code Style settings file can be located anywhere: it can be in the default place as well as any other as it can be passed as an argument in the command line (-s parameter). So keeping the file with Code Style settings in the VSCode extension folder is OK as long as that parameter is used.

ftp-kr - Cannot edit in read-only editor

I cannot figure out how to use the ftp-kr extension for VS Code properly. I have read and re-read the GitHub Wiki and the README documentation and cannot find any other help for my issue. I posted this question to the project Issues on GitHub but have yet to receive a response.
ftp-kr is just a simple extension for editing files via FTP that are located on a remote server. Many other users seem to be using the extension with no issue.
I installed the extension, and then I successfully edited the connection settings (in ftp-kr.json) and successfully made a connection to the remote server I am trying to edit files on.
I opened the FTP-KR: EXPLORER pane to look at all of the files on the server, but if I double-click any of the files to open them and then try to edit them, I am unable to type and just get a warning in VS Code that says "Cannot edit in read-only editor".
I have tried right-clicking on files and clicking the "Download This" button, thinking that maybe I need to download a local copy of the files to edit before uploading the changes. However, whenever I click the "Download This" option on any file in the ftp-kr Explorer, it just gives me an error message that says "[file_name] is not in remotePath".
I tried running the >ftp-kr: Download All command, but it just spits out a notice that says "Nothing to DO".
How do I edit files located on the remote server and save those changes to the server?
P.S. I have tried the solutions found in this question but unfortunately none of them seem to work. Particularly, "code-runner: Run in terminal" is not in my settings and "Edit in Local" is not a context menu item that appears in my editor.
After a number of months, I finally have a solution to this thanks to the developer eventually responding on GitHub. There are a few things going on here.
Any file that a user wishes to modify must be downloaded as a local copy on the user's machine first and then that copy can be uploaded to the webserver via FTP.
ftp-kr cannot auto-download individual files. (Either when they are double-clicked on or through any other method.) It can only download entire directories, and those directories can be changed by using the localPath and ignore options in the configuration file, then stopping and restarting the ftp connection.
The "Download This" context menu option that appears is a piece of non-implemented code. It will not do anything.
>ftp-kr: Download All is the preferred way (by the developer's intent) to download the remote files onto the user's computer. The fact that it was returning an error before was a bug which has now been fixed.
Confusingly, the user can view the filenames and context of every file on the remote file system using a convenient tree view, you just cannot simply download any of those files individually.
In all, this plugin does not provide the functionality that I hoped it would have. (Namely, being able to easily download, modify, and upload individual files.) So I know how to properly use it, I will just be switching to a different plugin for my purposes.

Not able to check out files with long names in ClearCase Explorer

I am not able to find checkout option for a file when I right click on it in ClearCase explorer while the option is available for rest of the files.
The only difference is that the file I want to check in has a very long name ( I am using Windows ).
While I am able to check in via cleartool commands, it isn't possible from front end ( CC explorer) Is there any way to check out such files from CC explorer?
There are two possible causes for a checkout unavailable:
the path of the file itself is too long (combined with the long filename, more than 256 characters): a subst command can help shorten the path.
or the file is already checked out.
A cleartool status can help distinguish between those two cases.
And a cleartool lsvtree -graph aFile (replace aFile with your long filename) can help see the file history and see if it is checked out (reserved or not) in another view.
The window 255 characters restriction for file name can't be bypass or any sidestep if it.
You have the following options:
1. Try to shorten the name. Including all the folders that are the prefix for the view. Like vonC suggested.
2. Try create the view on Linux, and mount the folder to some shared area that can be seen in windows.
3. Use dynamic view, but Im not sure it will work.
Keep in mind, that other apps can also fail even after you solve it for clearcase as it is a Windows problem. Like msbuild or visual studio.

I need to rename a TFS folder-full of files, to remove a specific block of text

I'm using VS 2015, so the TFSCMDLets add-in for 2015. TFS server is 2013.
The old "New-TfsPendingChange -Rename" syntax that I found here on SO is no longer supported, both per the docs and per the error messages I get when I try.
I can't just check them out and rename them using the filesystem rename command, because that causes TFS to lose track of the file.
I've also tried this using tf.exe, where the commands I need are available, but it can't seem to figure out the workspace to use, even though the containing folder only maps to a single workspace. In this case it works fine when passed a literal filename, but fails when passing a path using foreach, like this:
tf workspaces /collection:devtfs\DeltaWA_ITA_BI
dir "C:\TFS\BusinessIntelligence\Database\Reporting_Prod\Test Views\" -filter "*.View.sql" | foreach { $newname = $.Name -replace ".View.sql", ".sql"; tf rename $ $newname }
Does anyone have a sample script that works in VS2015, TFS 2013?
You should avoid renaming items managed by TFVC using your operating system (for example, using Windows File Explorer, or the rename command in the Windows command prompt). Instead, do this in Source Control Explorer:
In Source Control Explorer, select the file that you want to edit,
open its shortcut menu, and choose Rename.
Type the desired name for the item.
If you want to use command prompt or script to do this, you could use tf rename command. Not sure the detail error message for your workspace error.
However, you need to make sure that you are running the commands from a mapped folder, you can run tf workfold to double check if the current folder is mapped or not.
If it's mapped and the error still exists, you might have a problem with your workspace cache. Try to remove cache through tf workspaces command:
tf workspaces /remove:(*|workspace1[,workspace2,...])
/collection:(*|TeamProjectCollectionUrl)
The overall answer turned out be in two parts:
1. You really must execute tf.exe in the folder where you want the work done. I saw this in the code I looked at, but didn't understand it was a requirement.
2. This means you have to get tf.exe into your path. Got help from a coworker on that.
After that, my tiny script worked as desired.
I still don't see a way to do this with TFS CMDLets. This is kind of a pity, bu not really important.
Thanks for the assistance!

How to use Pentaho Spoon to rename files that do not have an extension

I am new to using Pentaho Spoon. I have about 100 text files in a folder, none of which have file extensions. I have found that if I create a job and move a file, one at a time, that I can simply rename that file, adding a .txt extension to the end. What I'd like to do is create a job that goes through and renames each file and adds the .txt extension. I've tried using the regex, but can't seem to get it to work because there's no file extension.
Any help would be greatly appreciated.
It's a pretty straightforward solution but you need to use a Transformation, as Job steps won't do it, ok?
You need the following steps:
Get File Names: just add your folder and the RegExp ".*" (without the double quotes), so everything is listed. Check if it's ok with "Show filename(s)..." button.
Modified Java Script Value: declare a new_filename var concatenating the desired extension. Remember to click "Get Variables" after adding the script to output the new field.
var new_filename = filename + '.txt';
Process Files: select Operation = Move and filename/new_filename as your source/target filenames.
That's it!
Renaming a group of files is one thing I wouldn't use Kettle for. Why not let the shell do what the shell does best?
rem example for Windows CMD shell
ren absolute-path-to-folder\*. *.txt
This can be done using a Shell job entry, if you find reason to do it in Kettle at all.
I've seen "just use a shell script" answers for this before. Works great if you can guarantee you're Kettle server is on the same OS as the developer workstation. I'm in an environment where the Dev/Spoon instance is Windows, but the Prod/Kettle environment is Linux, so you can't write one script file to rule them all.
As for "Why on earth would you do this?", my scenario is an integration scenario. We're using Pentaho for Data Integration, but a different tool for Enterprise Integration. I want a Pentaho Job to produce an output file, and I want my Enterprise Integration tool to pick up the file and do something with it, but not before Pentaho is done writing the file. Renaming helps avoid a race condition when the Enterprise Integration solution recognizes the file is there, but Pentaho isn't done writing it yet.
If I could rename a set of files, for example change from test..csv.processing to test..csv, then Pentaho would create the file initially with the .processing extension, and then remove the extension once it's done. The Enterprise Integration solution that's looking for test.*.csv won't start processing the file until Pentaho renames it. Bingo, no race condition.