Output file name on XP can not have a colon character

My Perl script on NT happily creates a file (over Samba on a Unix file server) with a name like "sql.031906.22:34.1" . However, refuses to do it on Active Perl XP when ':' is in the name. why?

thanks, jerzyb


jerzybAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kim RyanIT ConsultantCommented:
Microsoft filesystems, such as NTFS, do not support the use of certain characters in filenames. Characters such as colon (:), asterisk (*), question mark (?) and vertical bar (|) are not allowed. The colon character is reserved for a drive specifier, such as C:\file.txt
0
Kim RyanIT ConsultantCommented:
Perhaps NT is more tolerant of the colon but XP is stricter. Are you using the latest version of Samba?
0
jerzybAuthor Commented:
pretty old, 2.0.4
will try something newer
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

ozoCommented:
Can you create at filename with ':' in the name using anything other than perl?
0
jerzybAuthor Commented:
its not samba: I built a new Perl script on XP and traced the SMB protocol: when I run it with a file name with a colon (:), it does not even go to Samba; as soon as I change colon into a period (.), it works. Also, I can not create file names with a colon outside Perl for both NT and XP. So, both NT and XP are equally dum, but somehow NT Perl took care of that.

I guess Active Perl for XP is the problem.

Is there a way to bypass, escape it or something? I want colons in my file names :-)

jerzyb
0
Kim RyanIT ConsultantCommented:
It's not iseal but as a work around you could use perl to name the files something like sql.031906.22_colon_34.1"
Then run a small script on Unix file server to repalce _colon_ with :

Have you tried asking this question on a samba newgroup or mailing list?

Or could you run your main script directly on the unix server?

Not sure why you need colons, it just seems to be a seperator between hours and minutes. Your app is more poratable if you can avoid these characters in file names.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jerzybAuthor Commented:
Come on, teraplane. I think I proved that its NOT samba: the XP is not even trying to go out on the wire. As for running on the server, I would gladly run it on Unix if I could but the whole company is going Microsoft (still remember everyone blindly following IBM as recently as 20 years ago). ActivePerl people might know but their official line is not to use colon.

Have no choice, bite the bullet and modify all programs that read those files.

Thanks anyway.
0
ahoffmannCommented:
it's not perl but the used native M$ dll for I/O.
Try to find a perl.exe linked against another dll, AFAIK plain old perl-4 executable from DOS does not rely on this restriction.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.