Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win Path ??

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi
I am working a upload script
Uploading with Unix client works great but when it comes to win it just erase
my file


$file =~ s{.*/} {} if $file =~ m{^/};##Removes unix path

$file =~ s{.*\\} {} if $file =~ m{[A-Z]:\\};##Removes Win path


What it wrong with my Win path, it just empties my file to 0kb
Thanks /Fredrik
 
Hi again

This one works fine on Linux/Unix but not on Win, someone knows how to change it so it works on Win ??


$file =~ m{([^/\\:]*)$};

##Removes all '/' from Unix and only keeping the filename


Thanks
/Fredrik
 
Fred, Hi.

I don't think you need to worry about whether a path is delimited by \ or /, Perl understands all that for you. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Doesn't this print the current time? I'm trying to get the last modified date of another file. I did look at the perldoc (thanks!) but much of it was beyond my abilities, I'm afraid.

Don
don@ctagroup.org
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT (only when I have to!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top