LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   filename changes (https://www.linuxquestions.org/questions/linux-newbie-8/filename-changes-730119/)

invader44 06-02-2009 07:57 AM

filename changes
 
I am running slackware 12.0 on my machine. I have two files on my windows computer that I wanted to bring over to my slackware server. So I copied the two files to a floppy disk on my windows machine. Then went over to my slackware server and did a /mnt/fd0 /mnt/floppy. I did this as root the only strange thing is when I go to look at the files the files are renamed or what I think is happening is they are shortened. So my filename that it should be is this_is_the_filename.ca this is just an example but that is what the filename should be named, after I mount my floppy and look at the files on the floppy disk they are renamed to
this this_p~1.ca why is slackware doing this? Am I mounting the floppy incorrectly? Is there a way to tell slackware to mount to another filesystem type that windows is using?

Thanks in advance

Simon Bridge 06-02-2009 08:03 AM

All filenames on your windows machine follow the 8.3 dos format.
To support long filenames, windows uses the first 6 characters, then a tilda, then a number.

So

thisisalongname.txt becomes thisis~1.txt
thisisanotherone.txt becomes thisis~2.txt

these are the names that are actually attached to the file.

The name that gets displayed alongside the icon is read off a table someplace.

When you copied the files - linux read them correctly as MS wrote them. Windows has been lying to you - but you'll get used to this. (It's actually a feature - it means your files will be backwards compatible with older machines and media which use the old FAT file system.)

AFAIK: the way to get the whole name is to put the file on ntfs media when you walk it over, or transfer the file over a network.

jolphil 06-02-2009 08:04 AM

My guess it is DOS doing it when it was put on the floppy..
jolphil
Edit : Simon, you beat me by 60 seconds..One finger typeing here..
jolphil

Simon Bridge 06-02-2009 08:28 AM

Quote:

Originally Posted by jolphil (Post 3560230)
My guess it is DOS doing it when it was put on the floppy..
jolphil
Edit : Simon, you beat me by 60 seconds..One finger typeing here..
jolphil

No worries ;)

- the floppy is probably FAT32 - which is fine with long filenames.
DOS won't enter into it unless this is a very old Windows (95?) or OP used the terminal to copy the program.

This is actually what Windows does before Vista ... dunno about Vista. Technically, I'd expect the same thing to happen trasferring to windows unless there is some mechanism which stores the long filename on the floppy too. May be worth looking at that floppy with ls -l

Suggested exercize - in Windows, open a DOS terminal and list all files in a directory - see what happens to the long file names?

But you are right - it's nothing to do with linux.
I don't think I've seen this with file transfers involving direct-mount ntfs partitions and ntfs-3g. Of course, it's only two files, so they can be manually renamed.

invader44 06-02-2009 11:10 AM

thanks for both replys so fast. that makes sense now why it windows shortened the filenames. I used the cp command instead to rename them with the long filename that I needed. hopefully if someone else runs into this problem it may help them also. I did a cp filename_p~1.ca /etc/newdirectory/longfile_name_thing.ca and it worked! hope this can help somoone else.

paul81 06-03-2009 07:25 AM

Assuming that both computers are on the same network: why not using the application winscp for transferring files to your linux computer? This will speed up your actions :) You can find the program here: http://winscp.net/eng/download.php
It's freeware, so you won't have to pay :)


All times are GMT -5. The time now is 07:28 AM.