Sublime Forum

File fails to open when opened via Perforce [Windows]

#1

When opening any file that’s not on my hard drive (e.g. network drive) the file fails to open and the text area appears empty. This only happens when I open a file from Perforce (P4V - version control). See the log message below, straight from the console.

Unable to open /C/my-network-server/opt/www/alextiley/public_website/style/global.css

It looks to me as if Sublime thinks the file is on my C drive. It’s not - the full path is /my-network-server/opt/www/alextiley/public_website/style/global.css. Opening files from perforce has been completely fine since I first started using Sublime Text 2 - the issue has arisen since the last update (Thursday 22nd Feb, 2012).

0 Likes

#2

How are you trying to open the file, specifically? I always open files by dragging them into the editor, but files on network shares open fine for me. As does doing ctrl+o and typing the UNC path in (e.g., \machine\path\to\file.txt).

Interestingly, the path you have there doesn’t look like a proper path on windows, maybe that’s the issue? (But maybe it’s Sublime converting a valid UNC path to some internal representation incorrectly.)

0 Likes

#3

[quote=“alexrussell”]How are you trying to open the file, specifically? I always open files by dragging them into the editor, but files on network shares open fine for me. As does doing ctrl+o and typing the UNC path in (e.g., \machine\path\to\file.txt).

Interestingly, the path you have there doesn’t look like a proper path on windows, maybe that’s the issue? (But maybe it’s Sublime converting a valid UNC path to some internal representation incorrectly.)[/quote]

I’ve just modified my original post. The issue occurs when opening a file from Perforce. It seems after some investigation that when opening straight from the network drive it displays correctly. It only occurs when opening via perforce. This is a new bug as opening via Perforce worked fine before yesterdays update.

0 Likes

#4

I’m having this problem also, and I don’t use perforce.

I just run the following command from the Powershell command-line:

sublime_text.exe \\drake\users\jaraco\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

It launches Sublime Text 2 with a new file with the following path:

C:\drake\users\jaraco\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

In other words, it appears to be treating the leading double-backslash as a single backslash.

I get the same behavior if I try to escape the backslashes using \\drake\users… or if I use forward slashes as in //drake/users/…

If I attempt to open the file using the File | Open dialog, it will open. The problem appears to be with the command-line handling.

This is a regression in 2181 from the previous release.

0 Likes