#! c:\perl\bin\perl.exe use strict; use Win32API::File 0.02 qw( :ALL ); my $server = shift || Win32::NodeName; my $path; ($server eq Win32::NodeName)?($path = "c:\\winnt\\"): ($path = "\\\\$server\\c\$\\winnt\\"); my $astream = Win32API::File::CreateFile($path."lanmannt.bmp:test.txt", GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE, [], CREATE_NEW,[],[]); my $str = "This is a test of alternate data streams"; if ($astream) { Win32API::File::WriteFile($astream, $str, length($str), [], []); Win32API::File::CloseHandle($astream); print "Alternate file stream created.\n"; } else { print "Alternate file stream creation failed: $^E\n"; }