Discussion:
VSSDatabase.VSSItem fails in 6.0d when Spec includes %
(too old to reply)
Joe
2006-04-04 20:33:32 UTC
Permalink
The following VB6 code using a '%' in the file name works fine on 6.0c
(Build 9447) , but fails with an "Invalid SourceSafe syntax" on 6.0d (Build
9848):

+++++
Sub main()
Dim db As VSSDatabase
Set db = CreateObject("SourceSafe")
db.Open "<<your path to srcsafe.ini here>>", "guest"

Dim item As VSSItem
Set item = db.VSSItem("$/FileWith_1%InName.txt")
MsgBox item.Spec
End Sub
------

Please forgive the VB6 we are actually scripting from a different language
through the automation interface.

Anyone seen anything like this? Hotfixes? Workarounds? (Anything besides
reverting to 6.0c)

Thanks, Joe
Alin Constantin [MSFT]
2006-04-05 02:05:41 UTC
Permalink
Characters like %, $, *, ?, etc are not legal as part of the filenames in
VSS database.
VSS 6.0d behavior is correct - it fixed a bug that existed in VSS 6.0c.
I would not revert to VSS 6.0c - while you can create files with % in names
with it, it's most likely you'll run into problems later with those files...

Alin
--
Alin Constantin
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Joe
The following VB6 code using a '%' in the file name works fine on 6.0c
(Build 9447) , but fails with an "Invalid SourceSafe syntax" on 6.0d
+++++
Sub main()
Dim db As VSSDatabase
Set db = CreateObject("SourceSafe")
db.Open "<<your path to srcsafe.ini here>>", "guest"
Dim item As VSSItem
Set item = db.VSSItem("$/FileWith_1%InName.txt")
MsgBox item.Spec
End Sub
------
Please forgive the VB6 we are actually scripting from a different language
through the automation interface.
Anyone seen anything like this? Hotfixes? Workarounds? (Anything besides
reverting to 6.0c)
Thanks, Joe
Joe
2006-04-05 15:47:26 UTC
Permalink
Thanks.

It seems to me like a change from 6.0c rather than a bug fix. The only
mention of the matter I can find in the 6.0c doc is in the last sentence in
the explanation of the error message "The filename '<File>' contains illegal
characters. The file will be ignored." Which says:

Legal characters from 32-255 characters in length, but not: ?”/\<>*|:

Which looked the same to me as filesystem characters.

At any rate, its nice at least to know what's going on. (and have a complete
explanation of valid characters in the 6.0d docs).

-Joe
Post by Alin Constantin [MSFT]
Characters like %, $, *, ?, etc are not legal as part of the filenames in
VSS database.
VSS 6.0d behavior is correct - it fixed a bug that existed in VSS 6.0c.
I would not revert to VSS 6.0c - while you can create files with % in
names with it, it's most likely you'll run into problems later with those
files...
Alin
--
Alin Constantin
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Joe
The following VB6 code using a '%' in the file name works fine on 6.0c
(Build 9447) , but fails with an "Invalid SourceSafe syntax" on 6.0d
+++++
Sub main()
Dim db As VSSDatabase
Set db = CreateObject("SourceSafe")
db.Open "<<your path to srcsafe.ini here>>", "guest"
Dim item As VSSItem
Set item = db.VSSItem("$/FileWith_1%InName.txt")
MsgBox item.Spec
End Sub
------
Please forgive the VB6 we are actually scripting from a different
language through the automation interface.
Anyone seen anything like this? Hotfixes? Workarounds? (Anything
besides reverting to 6.0c)
Thanks, Joe
Alin Constantin [MSFT]
2006-04-06 05:23:55 UTC
Permalink
It is true, VSS6.0c and older allowed files with % in the name.
However, they caused problems later (I don't remember exactly what was
broken).
To fix them, it was decided in VSS 6.0d to disallow % in the file names.
Invalid characters in filenames are: /\";<>|:*?$% (tab)
I hope that's the complete list.
There may be other limitations (e.g. in VSS6 you can't have a file starting
with dot whose name contains another dot - this limitation has been removed
in VSS2005)
--
Alin Constantin
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Joe
Thanks.
It seems to me like a change from 6.0c rather than a bug fix. The only
mention of the matter I can find in the 6.0c doc is in the last sentence
in the explanation of the error message "The filename '<File>' contains
Which looked the same to me as filesystem characters.
At any rate, its nice at least to know what's going on. (and have a
complete explanation of valid characters in the 6.0d docs).
-Joe
Post by Alin Constantin [MSFT]
Characters like %, $, *, ?, etc are not legal as part of the filenames in
VSS database.
VSS 6.0d behavior is correct - it fixed a bug that existed in VSS 6.0c.
I would not revert to VSS 6.0c - while you can create files with % in
names with it, it's most likely you'll run into problems later with those
files...
Alin
--
Alin Constantin
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Joe
The following VB6 code using a '%' in the file name works fine on 6.0c
(Build 9447) , but fails with an "Invalid SourceSafe syntax" on 6.0d
+++++
Sub main()
Dim db As VSSDatabase
Set db = CreateObject("SourceSafe")
db.Open "<<your path to srcsafe.ini here>>", "guest"
Dim item As VSSItem
Set item = db.VSSItem("$/FileWith_1%InName.txt")
MsgBox item.Spec
End Sub
------
Please forgive the VB6 we are actually scripting from a different
language through the automation interface.
Anyone seen anything like this? Hotfixes? Workarounds? (Anything
besides reverting to 6.0c)
Thanks, Joe
Joe
2006-04-10 17:17:47 UTC
Permalink
Thanks Alin,

I found this page
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/guides/html/vsgrfssugrnaming_syntax_conventions_and_limitations.asp.
Which lists a few more forbidden characters than you have below.

I wrote a script to check for names that fail in 6.0d. It found the files
with '%', '$', '(', and ')' in the names, but missed the projects with '['
and ']' in the names.

--Joe
Post by Alin Constantin [MSFT]
It is true, VSS6.0c and older allowed files with % in the name.
However, they caused problems later (I don't remember exactly what was
broken).
To fix them, it was decided in VSS 6.0d to disallow % in the file names.
Invalid characters in filenames are: /\";<>|:*?$% (tab)
I hope that's the complete list.
There may be other limitations (e.g. in VSS6 you can't have a file
starting with dot whose name contains another dot - this limitation has
been removed in VSS2005)
--
Alin Constantin
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Joe
Thanks.
It seems to me like a change from 6.0c rather than a bug fix. The only
mention of the matter I can find in the 6.0c doc is in the last sentence
in the explanation of the error message "The filename '<File>' contains
Which looked the same to me as filesystem characters.
At any rate, its nice at least to know what's going on. (and have a
complete explanation of valid characters in the 6.0d docs).
-Joe
Post by Alin Constantin [MSFT]
Characters like %, $, *, ?, etc are not legal as part of the filenames
in VSS database.
VSS 6.0d behavior is correct - it fixed a bug that existed in VSS 6.0c.
I would not revert to VSS 6.0c - while you can create files with % in
names with it, it's most likely you'll run into problems later with
those files...
Alin
--
Alin Constantin
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Joe
The following VB6 code using a '%' in the file name works fine on 6.0c
(Build 9447) , but fails with an "Invalid SourceSafe syntax" on 6.0d
+++++
Sub main()
Dim db As VSSDatabase
Set db = CreateObject("SourceSafe")
db.Open "<<your path to srcsafe.ini here>>", "guest"
Dim item As VSSItem
Set item = db.VSSItem("$/FileWith_1%InName.txt")
MsgBox item.Spec
End Sub
------
Please forgive the VB6 we are actually scripting from a different
language through the automation interface.
Anyone seen anything like this? Hotfixes? Workarounds? (Anything
besides reverting to 6.0c)
Thanks, Joe
Alin Constantin [MSFT]
2006-04-11 02:11:57 UTC
Permalink
That page is from VSS6 times. VSS2005 allows more characters than indicated
in that page.
',.=^@!{}()[]
are all characters accepted in the file names in VSS2005, and I think even
vSS 6.0d accepts them.
--
Alin Constantin
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Joe
Thanks Alin,
I found this page
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/guides/html/vsgrfssugrnaming_syntax_conventions_and_limitations.asp.
Which lists a few more forbidden characters than you have below.
I wrote a script to check for names that fail in 6.0d. It found the files
with '%', '$', '(', and ')' in the names, but missed the projects with '['
and ']' in the names.
--Joe
Post by Alin Constantin [MSFT]
It is true, VSS6.0c and older allowed files with % in the name.
However, they caused problems later (I don't remember exactly what was
broken).
To fix them, it was decided in VSS 6.0d to disallow % in the file names.
Invalid characters in filenames are: /\";<>|:*?$% (tab)
I hope that's the complete list.
There may be other limitations (e.g. in VSS6 you can't have a file
starting with dot whose name contains another dot - this limitation has
been removed in VSS2005)
--
Alin Constantin
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Joe
Thanks.
It seems to me like a change from 6.0c rather than a bug fix. The only
mention of the matter I can find in the 6.0c doc is in the last sentence
in the explanation of the error message "The filename '<File>' contains
Which looked the same to me as filesystem characters.
At any rate, its nice at least to know what's going on. (and have a
complete explanation of valid characters in the 6.0d docs).
-Joe
Post by Alin Constantin [MSFT]
Characters like %, $, *, ?, etc are not legal as part of the filenames
in VSS database.
VSS 6.0d behavior is correct - it fixed a bug that existed in VSS 6.0c.
I would not revert to VSS 6.0c - while you can create files with % in
names with it, it's most likely you'll run into problems later with
those files...
Alin
--
Alin Constantin
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Joe
The following VB6 code using a '%' in the file name works fine on 6.0c
(Build 9447) , but fails with an "Invalid SourceSafe syntax" on 6.0d
+++++
Sub main()
Dim db As VSSDatabase
Set db = CreateObject("SourceSafe")
db.Open "<<your path to srcsafe.ini here>>", "guest"
Dim item As VSSItem
Set item = db.VSSItem("$/FileWith_1%InName.txt")
MsgBox item.Spec
End Sub
------
Please forgive the VB6 we are actually scripting from a different
language through the automation interface.
Anyone seen anything like this? Hotfixes? Workarounds? (Anything
besides reverting to 6.0c)
Thanks, Joe
Loading...