in reply to Re: Problem running shell command from Perl
in thread Problem running shell command from Perl
Let me give a bit more detail about that I'm trying to do. I have an app that allows the user to browse through directories and select files whose names are then passed to various other applications. Some of these apps can't handle filenames that contain unicode (non 7-bit ascii) characters). I want to modify my app so that if the user selects a file or directory containing unicode characters, my app can create the 8dot3 name on the fly. I can then run the filename through Win32::GetShortPathName to get a name consisting entirely of 7-bit ascii characters.
To address the points mentioned in your post:
1. 8dot3 names are already enabled on my system
2. understood
3.The perlmonks website converted the chinese characters to the notation that ended up in the post, apparently due to the fact that the filename was contained in a "<code>" section. Here's the real filename:
C:\Users\James\Music\國語懷念老歌 Vol. 2
So if I paste the following into a windows command shell
fsutil file setShortName "C:\Users\James\Music\國語懷念老歌 Vol. 2" "Vol~002"
the 8dot3 name is created as desired. Now I need to find a way to do this in my perl program.
4. not a problem in my case
5. I need to preserve the original file names, so renaming is not an option.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Problem running shell command from Perl
by CrashBlossom (Beadle) on Jun 20, 2023 at 15:19 UTC | |
by harangzsolt33 (Deacon) on Jun 20, 2023 at 16:59 UTC | |
by CrashBlossom (Beadle) on Jun 20, 2023 at 18:59 UTC | |
by harangzsolt33 (Deacon) on Jun 20, 2023 at 19:12 UTC | |
by CrashBlossom (Beadle) on Jun 20, 2023 at 19:40 UTC |