Windows cannot open directory with too long name created by Linux

0

1

My laptop has two OSes: Windows 7 and Ubuntu 10.10. A partition of Windows 7 of format NTFS is mounted in Ubuntu.

In Ubuntu, I created a directory under somehow deep path and with a long name for itself, specifically, the name for that directory is "a set of size-measurable subsets ie sigma algebra". Now in Windows, I cannot open the directory, which I guess is because of the name is too long, nor can I rename it. I was wondering if there is some way to access that directory under Windows? Better without changing the directory if possible, but will have to if necessary.

Thanks and regards!


Update:

This is the output using "DIR /X" in cmd.exe, which does not shorten the directory name:

F:\science\math\Foundations of mathematics\set theory\whether element of a set i
s also a set\when element is set\when element sets are subsets of a universal se
t\closed under some set operations\sigma algebra of sets>DIR /X
 Volume in drive F is Data
 Volume Serial Number is 0492-DD90

 Directory of F:\science\math\Foundations of mathematics\set theory\whether elem
ent of a set is also a set\when element is set\when element sets are subsets of
a universal set\closed under some set operations\sigma algebra of sets

03/14/2011  10:43 AM    <DIR>                       .
03/14/2011  10:43 AM    <DIR>                       ..
03/08/2011  10:09 AM    <DIR>                       a set of size-measurable sub
sets ie sigma algebra
02/12/2011  04:08 AM    <DIR>                       example
02/17/2011  12:30 PM    <DIR>                       general
03/13/2011  02:28 PM    <DIR>                       mapping from sigma algebra t
o R or C i.e. measure
02/12/2011  04:10 AM    <DIR>                       msbl mapping from general ms
bl space to Borel msbl R or C
02/12/2011  04:10 AM             4,928              new file~
03/14/2011  10:42 AM    <DIR>                       temp
03/02/2011  10:58 AM    <DIR>                       with Cartesian product of se
ts
               1 File(s)          4,928 bytes
               9 Dir(s)  39,509,340,160 bytes free

Tim

Posted 2011-03-14T14:27:48.083

Reputation: 12 647

Hmm, it doesn't include that extra column that includes the short version of the name (which is what it normally does -- that column is normally included just before the long filename). – Randolf Richardson – 2011-03-14T15:19:52.173

Try using this tool, it may work (it's a text-mode Norton Commander clone that has native 32-bit and 64-bit Windows binaries); when you press CTRL-N in this application, it toggles between short and long filenames: http://www.farmanager.com/

– Randolf Richardson – 2011-03-14T15:21:11.330

@Randolf: Are you using cmd.exe, command prompt, or what else for command line operations? – Tim – 2011-03-14T15:21:31.330

No. Just "Cmd" is all (that would be "cmd.exe") to get to the DOS prompt. – Randolf Richardson – 2011-03-14T15:22:38.270

@Randolf: Thanks! using the tool you linked I can now go into the directory with long name. If I want to open some saved files under it in other applications, what shall I do next? Do I need to rename the directory to a shorter name? If yes, under its parent directory, I still cannot "rename oldname newname". – Tim – 2011-03-14T15:31:12.583

@Tim: Okay, excellent, so we have some progress! You can see the short name too, right? If so, you can try manually typing that "REN" command on FAR Manager's DOS prompt to rename the directory with its short name as the first parameter and the new name as the second parameter. If that doesn't work, then you'll have to do this from the server (or over an SSH session -- check the permissions while you're there, it might be that you only have "read" access to that directory). – Randolf Richardson – 2011-03-14T15:38:55.557

@Randolf: Sorry for replying late. I just had to run to school. Well, I still can't find the shorter name. When I typed "DIR /X" under far Manager, the output flashed away so quickly that I could not catch if there is shorter name there. How can I get it? Thanks! – Tim – 2011-03-14T16:34:57.170

Answers

1

Linux won't assign short names to any files on NTFS partitions. "DIR /X" won't show a short name unless the file was created under Windows. There's a command-line program (not installed by default) which can be used to manually assigning or modifying short file names under Linux.

An NTFS file is not required to have a short name. By default, Windows assigns a short name, but this can be disabled in Windows settings.

Anonymous

Posted 2011-03-14T14:27:48.083

Reputation: 11

1

Windows has maximum filename length limitations. If you can't rename by using the short filename, then you'll have to use the Unix/Linux shell on the server to accomplish the renaming.

At the DOS prompt in Windows, if you type "DIR /X" you can see the short filenames.

Randolf Richardson

Posted 2011-03-14T14:27:48.083

Reputation: 14 002

@Randolf: Thanks! (1) I cannot even rename the directory in command window using "rename oldname newname". Any way without going back to Linux? or even better without changing the name of the directory? (2) what do you mean by "DIR /X"? I type it literally and the output is nothing different than "dir" alone. – Tim – 2011-03-14T14:40:37.103

@Tim: The "DIR /X" command should include an extra column before the long filename that shows you what the short filename is. A short filename has a maximum of 8 characters for the base, and 3 characters for the suffix (preceded by the only period), and often includes the tilde ("~") character near the end of the base before at least one digit). You'll have to type "CD .. && DIR /X" if you're in the directory you wish to rename (the "CD .." command will take you up one level in the path hierarchy). – Randolf Richardson – 2011-03-14T14:49:07.520

@Randolf: Thanks! (1) I cannot go into the directory with a long name, and I am now under its parent directory so I don't quite understand how "CD .. " can help here. (2) Do you mind post an example to show how to display the short name for that directory? I am still confused about how to accomplish that. Thanks! – Tim – 2011-03-14T15:05:16.740

@Tim: Okay, so that directory you're trying to access is a sub-directory of your current working directory? In that case the "DIR /X" command should reveal the short name in the listing, and then you can use that short name. For example, if your short name is "THISIS~1" for a sub-directory named "This is a test," then you could use the DOS command "CD THISIS~1" to get into it, or rename it like so: REN THISIS~1 MyDir – Randolf Richardson – 2011-03-14T15:08:55.503

If you'd be willing to include the output of your directory using the "DIR /X" command, I could write an example for you. – Randolf Richardson – 2011-03-14T15:09:30.497

@Randolf: Thanks! I tried "DIR /X" in both cmd.exe and Command Prompt, but it didn't give a shorter version of the name, instead the original long name. What types of command line are you using? Or other things I am missing? ADDED: See my update for the output. Thanks! – Tim – 2011-03-14T15:14:25.577

No other output. Just "cmd.exe" with no parametes to get to the DOS prompt in Windows 7 (64-bit edition). – Randolf Richardson – 2011-03-14T15:40:10.453

0

I had the same problem too. The first thing I thought was that the folder's name was too long. So, I renamed the folder using Linux but when I switch back to Windows the file inside the folder keep not open. My nub solution was to zip the folders in Linux and then unzip them from windows. So, Windows itself created all the folders all over again.

user2162842

Posted 2011-03-14T14:27:48.083

Reputation: 1