Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Script for create a file name with Invalid characters in windows

9 views
Skip to first unread message

bhanu chaitanya abbaraju

unread,
Nov 2, 2012, 9:19:58 AM11/2/12
to begi...@perl.org
Hi All,

Can any one help me, how can we create a file name with invalid characters
('?','/') in windows. Generally, Windows OS can not allow to create a file
name with invalid characters like '?,/' . But, I heard that we can able to
do with Perl script. If any one know about this please let me know.

Thank you,
A.Bhanuchaitanya.

Shlomi Fish

unread,
Nov 2, 2012, 10:31:45 AM11/2/12
to begi...@perl.org
Hi Bhanu,
I just tried this script on my Windows XP Virtual machine:

[CODE]
#!/usr/bin/perl

use strict;
use warnings;
use autodie;

open my $out, '>', 'foo?hello.txt';
print {$out} "Foobar\n";
close($out);

[/CODE]

It failed with an exception. The same script with the '?' in the filename
replaced by '-' worked fine. Why do you need to create such a filename? Is it
for cracking purposes? If you interested in using funny characters in the keys
of your data, then you should use a database of some sort:

http://perl-begin.org/uses/databases/

(Please reply to the list).

Regards,

Shlomi Fish

--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Parody of "The Fountainhead" - http://shlom.in/towtf

There is an IGLU Cabal, but its only purpose is to deny the existence of an
IGLU Cabal.
— Martha Greenberg

Please reply to list if it's a mailing list post - http://shlom.in/reply .
0 new messages