long-filenames

How to get long filename from ARGV

做~自己de王妃 提交于 2019-11-30 08:34:51
问题 I want to make a tool that takes some filenames as parameters, but when I use this code: ARGV.each do|a| puts "Argument: #{a}" end and I use drag and drop or "send to" in Windows, I get the short filename. So a file like "C:\Ruby193\bin\test\New Text Document.txt" becomes C:\Ruby193\bin\test\NEWTEX~1.TXT as the argument. There is no problem when I run the script from the commandline, with the longfilenames as parameters. How do i get the long filename when i use drag and drop or send to? 回答1:

How to get long filename from ARGV

旧城冷巷雨未停 提交于 2019-11-29 07:01:28
I want to make a tool that takes some filenames as parameters, but when I use this code: ARGV.each do|a| puts "Argument: #{a}" end and I use drag and drop or "send to" in Windows, I get the short filename. So a file like "C:\Ruby193\bin\test\New Text Document.txt" becomes C:\Ruby193\bin\test\NEWTEX~1.TXT as the argument. There is no problem when I run the script from the commandline, with the longfilenames as parameters. How do i get the long filename when i use drag and drop or send to? AShelly I don't know if it is possible to change the argument you recieve on a drag and drop, but you could

How do I create then use long Windows paths from Perl?

微笑、不失礼 提交于 2019-11-27 20:35:01
I have part of a build process that creates a hideously long paths in Windows. It's not my fault. It's several directories deep, and none of the directory names are abnormally long; they're just long and numerous enough to make it over MAX_PATH (260 chars). I'm not using anything other than ASCII in these names. The big problem is that the blow-up happens deep in the guts of Module::Build during the dist target, although I figure the build system doesn't matter because they'd make the same directories. Creating one of these overly-long directories with File::Path fails: use File::Path qw( make

Convert long filename to short filename (8.3) using cmd.exe

♀尐吖头ヾ 提交于 2019-11-27 12:21:54
I am trying to convert a long filename to a short filename (8.3) on Windows. A batch-file with a command line argument works as intended: short.bat : @echo OFF echo %~s1 calling short.bat C:\Documents and Settings\User\NTUSER.DAT returns C:\DOCUM~1\USER\NTUSER.DAT However, I don't like having an extra .bat-file for this. I would rather call cmd.exe with the whole command from a ruby script. How can I do this? As an intermediate step I tried to hardcode the path in the batch-file, but that does not work: short1.bat : @echo OFF SET filename="C:\Documents and Settings\User\NTUSER.DAT" echo

Does MAX_PATH issue still exists in Windows 10

我的梦境 提交于 2019-11-27 10:38:56
Can someone please tell us/me if the MAX_PATH issue still exists in (the technical preview of) Windows 10. And if it exists: How many characters can a path and an individual file name have? magicandre1981 The issue will be always present in Windows, to keep compatibility with old software. Use the NT-style name syntax "\\?\D:\very long path" to workaround this issue. In Windows 10 (Version 1607 - Anniversary Update) and Windows Server 2016 you seem to have an option to ignore the MAX_PATH issue by overriding a group policy entry enable NTFS long paths under Computer Configuration -> Admin

How do I create then use long Windows paths from Perl?

风流意气都作罢 提交于 2019-11-26 22:57:22
问题 I have part of a build process that creates a hideously long paths in Windows. It's not my fault. It's several directories deep, and none of the directory names are abnormally long; they're just long and numerous enough to make it over MAX_PATH (260 chars). I'm not using anything other than ASCII in these names. The big problem is that the blow-up happens deep in the guts of Module::Build during the dist target, although I figure the build system doesn't matter because they'd make the same

How to add a string to a string[] array? There's no .Add function

淺唱寂寞╮ 提交于 2019-11-26 19:39:15
private string[] ColeccionDeCortes(string Path) { DirectoryInfo X = new DirectoryInfo(Path); FileInfo[] listaDeArchivos = X.GetFiles(); string[] Coleccion; foreach (FileInfo FI in listaDeArchivos) { //Add the FI.Name to the Coleccion[] array, } return Coleccion; } I'd like to convert the FI.Name to a string and then add it to my array. How can I do this? You can't add items to an array, since it has fixed length, what you're looking for is a List<string> , which can later be turned to an array using list.ToArray() . Alternatively, you can resize the array. Array.Resize(ref array, array.Length

Convert long filename to short filename (8.3) using cmd.exe

情到浓时终转凉″ 提交于 2019-11-26 15:58:58
问题 I am trying to convert a long filename to a short filename (8.3) on Windows. A batch-file with a command line argument works as intended: short.bat : @echo OFF echo %~s1 calling short.bat C:\Documents and Settings\User\NTUSER.DAT returns C:\DOCUM~1\USER\NTUSER.DAT However, I don't like having an extra .bat-file for this. I would rather call cmd.exe with the whole command from a ruby script. How can I do this? As an intermediate step I tried to hardcode the path in the batch-file, but that

Does MAX_PATH issue still exists in Windows 10

£可爱£侵袭症+ 提交于 2019-11-26 15:17:40
问题 Can someone please tell us/me if the MAX_PATH issue still exists in (the technical preview of) Windows 10. And if it exists: How many characters can a path and an individual file name have? 回答1: The issue will be always present in Windows, to keep compatibility with old software. Use the NT-style name syntax "\\?\D:\very long path" to workaround this issue. In Windows 10 (Version 1607 - Anniversary Update) and Windows Server 2016 you seem to have an option to ignore the MAX_PATH issue by

How to add a string to a string[] array? There&#39;s no .Add function

孤人 提交于 2019-11-26 12:15:54
问题 private string[] ColeccionDeCortes(string Path) { DirectoryInfo X = new DirectoryInfo(Path); FileInfo[] listaDeArchivos = X.GetFiles(); string[] Coleccion; foreach (FileInfo FI in listaDeArchivos) { //Add the FI.Name to the Coleccion[] array, } return Coleccion; } I\'d like to convert the FI.Name to a string and then add it to my array. How can I do this? 回答1: You can't add items to an array, since it has fixed length, what you're looking for is a List<string> , which can later be turned to