View Full Version : files/folders between Windows & Linux
3rd November 2007, 04:52 PM
Should I anticipate any problems in moving files back and forth between Windows and Linux platforms? Assume I move them through desktop commands (mainly, to cut, copy, paste, rename, and delete files and folders and edit Linux permissions). For example, might contents change because they move even without opening any applications?
I wonder if moving could add a carriage return or a linefeed character to an unopened file; or is that only when opening in an application?
Linux has more file attributes (fortunately). Does that create a problem when moving to Windows or to Linux, other than that permissions are simply forgotten by Win and set to defaults by Linux?
I ask because I have a Win-formatted flash drive and copied a folder of files from a Linux box, and then had Win98SE count the folder's size on the flash. The folder, without compression or Linux-reformatting, was supposedly many times the size of the whole flash drive. Other folders, which originated on Win platforms, kept their normal sizes.
Should I worry? Should I do something special?
3rd November 2007, 06:24 PM
Share file is pretty straightforward, Never had problems with exchange files, but something you must remember: linux has case sensitive file names, that is a.bat and A.bat can be different files. In windows, that is not true and some files can become missing if you copy from ext3 to vfat filesystems.
No change carriage return line-feed by copy files. In linux, the owner of the files in vfat filesysytems mounted is the user who mount the drive.
24th November 2007, 05:43 PM
I've seen 3 other bad effects, too, although they may be due to using a flash thumb drive (Fedora Core 4 & Gnome Desktop 2.10.0):
-- Characters incompatible: Folder names with a certain character okay in Win are not okay with Linux. Linux replaces e-with-an-acute-accent (alt-keypad-0233) with a question mark, then can't copy the file because of the illegal character or wildcard in the name. I imagine other characters cause the same problem: probably any letter with a diacritical mark. And I imagine filenames may have the same problem. (Solution: Name a folder or file with a name allowed in both OSes and copy contents. However, the Linux/Gnome dialog reporting the problem truncates the path name, requiring detective work to figure which file/folder it's telling you about. Typical dialog message: "Error 'invalid parameters' while copying '/root/Desktop/f... Prot?g? WD400"; you can retry or skip (or I think cancel).)
-- Case when all caps: All-cap folder names when copied from the flash to the Linux machine become all lower-case, while mixed-case and lower-case names keep their original case; numerals in a name are ignored for this purpose. When restored and seen in Win98SE, names that were all-cap in Win that Linux or Gnome made all-lower-case show in Win in lower case. I don't know if this is also true of filenames, but it probably is; I think DISK34.ZIP had turned all-cap in Win and turned back to disk34.zip in Linux/Gnome. The only solution is to capitalize by hand according to what you remember the case was, since there's no record of what it was. Subfolders, too.
-- Size over capacity: A folder from my Linux machine when read in my Win98SE machine may be several times larger than the whole drive's maximum capacity. When Win errs, it can report up to 3.99GB on that 1GB drive (3.99 is a frequent Win favorite), even though I don't use disk-level compression. Compare numbers even when less than capacity: Win-formatted nominally-1GB flash with folders and files copied in Linux machine: Linux properties reported 275.8MB contents + 638.3MB free (which is 914.1MB), after which Win properties reported 345MB used + 638MB free = 983MB. I don't know if it has to do with how Linux extended attributes are stored, the specific attributes set for each file or folder confusing Win, Linux treating folders differently than Win does, or another cause.
The other day, everything on the flash drive cross-linked into a folder on the flash drive, the folder containing a backup of selected files from my Linux machine. I had probably made the backup by inserting the flash drive into the Linux machine and copying the files to a new folder on the flash, and not by networking. The specific subfolder the crosslinks were in was a previously empty subfolder (I know it was empty because I checked a backup of the flash itself.)
Stupidly, thinking that they were duplicates and not remembering that they could be crosslinks, I deleted a few, then looked at the root level and saw the corresponding folders intact there, so I deleted most of the remaining contents of that subfolder. The stupidity was that when I looked at the root level I should have refreshed the view. Had I done so, I would've noticed that the few folders I had deleted from the subfolder were also gone from the root level. Since I didn't refresh, I went and deleted everything else in the subfolder, except for a recursively crosslinked folder which Win wouldn't delete as presented (maybe I could've deleted individual contents). Fortunately, I had a recent backup of the flash and lost only 2-4 days' work, so I reformatted the flash in Win and restored from the backup.
A nice feature for Linux or a desktop would be explicit warnings when moving, copying, or renaming files as each inter-OS name conflict arises. Also nice would be a selectable option to see cautions when naming a file within one OS that would violate another OS's namespace if moved later.
Anyone else know of any other problems when copying files between Win and Linux?
25th November 2007, 06:18 PM
As to case, Win98SE doesn't change all-lower-case but displays it as capitals which can be edited and retained as lower case at the user's behest.
I had created a folder as all lower case (rpmnew) in a WinXP machine on a Win98SE-formatted flash drive which I took home and plugged into my nonnetworked 98SE box, where it displayed as RPMNEW. As an experiment, without renaming the folder or even opening it, I took the flash out and plugged it into my nonnetworked Linux machine, where the folder displayed as all lower-case.
Yet, consistently, if I name or rename a folder in 98SE in all lower case it continues to display the same way even after ejections and cold reboots. Win98SE, although not case-sensitive, is case-aware, except that case awareness doesn't apply to something it's never seen before. Exactly how it defines what it's seen before is something I don't know. How Linux's behavior influences that process, if at all, is also something I don't know.
An empty subfolder that likely had e-with-acute-accent (Win alt-kypad-0233) in its name but since had an underscore instead could not be deleted in Win98SE. I emptied the parent folder and tried to delete the parent but also couldn't. I moved the Win-formatted flash to my Linux box and deleted it with no problem. When I put it into my 98SE box after that, a new parent named .Trash-root turned up, containing what I had deleted; Win wouldn't let me delete it. So I took it out of the Win box, mounted it in Linux, deleted just the folder from trash, unmounted the flash, and put it back into the 98SE box. Again, .Trash-root turned up; I didn't look inside it this time, but it deleted easily.
Have I missed any other issues?
1st December 2007, 05:07 PM
I just used a colon in a Linux filename, and the file is on the desktop after a cold reboot. I can't do that in Win. So there's a character illegal in Win that Linux allows.
If any OS allows a file and a folder in the same folder to have the same name (including extension, if any), they can't be safely moved or copied to Linux or Win.
It occurs to me I don't remember seeing a general specification of the Linux namespace. Win has an alert that lists illegal characters (try to use one and the alert comes up). Maybe I've never used an illegal character in a Linux name but I only once or rarely even came across anything about a name length limit. Although I haven't searched yet and so asking is premature, anyone know of a name spec?
5th December 2007, 01:31 AM
How I move a file from Win to Linux makes a difference in what characters are preserved. But in the other direction, it apparently doesn't matter.
When I copy from Win via Samba onto the Linux Gnome desktop (while Win's screensaver runs), e-with-acute-accent is preserved both in a filename and inside the text file. But when I got the file from a Win-formatted flash thumb drive plugged directly into the Linux machine, without using Samba or SMB (to my knowledge), the character was replaced in the filename with a question mark.
When I tried to copy a file with a colon in its filename from the Linux Gnome desktop via Samba onto my Win95a desktop, and again onto a Win-formatted floppy, Linux or Gnome refused both times. The colon is not allowed in Win filenames.
15th December 2007, 05:56 PM
Links for more discussion -- some emphasizing that characters that are legal in Linux nonetheless wreak havoc within Linux and usually should not be used:
-- remote rogue users can cause a program to name a file with a dubious though legal name, such as ".." and not all programs filter such attempts
-- creating a name from data submitted by a user, where the name includes "/", can be a problem
-- globs can take a computer temporarily out of service, thus globbing can be used for a DDoS attack lasting hours
-- spaces confusing command shells
-- spaces that lead or trail
-- NIL character bad
-- leading hyphen bad if the name is passed to another program
-- control characters like esc, CR, and newline
-- using angle bracket, semicolon, slash, backslash, quote, etc., also used elsewhere for special priority purposes (e.g., angle brackets announce HTML tags)
-- "/" and NULL are delimiters in Linux kernel
-- UTF-8 encoding of filenames problematic & debate on whether any encoding should be imposed by kernel on users' input of filenames for non-JFS contexts; if any okay, besides UTF-8 best may be ISO-8859-1, but that's debated in replies
-- case-insensitivity as issue especially for mixed languages
-- Samba issues
-- JFS vs. other filesystems
-- use only alphanumerics (any case), underscores, and nonleading hyphens, as POSIX set, I think on the premise that that character set is portable across most OSes (DOS converts lowercase to capitals but perhaps only capitals should be used in the first place for best portability).
-- script to remove nonportable characters and replace leading hyphen with underscore
-- Win's DirectX and MIDI files: failing to check MIDI values; IE autoloads the file, so a web page could be written that would steal a visitor's drive contents, erase a visitor's hard drive, etc.
-- data should be checked when received and again before use if places are separate
-- rather than check for illegal data, check that all data is legal, because the difference is a gray area hackers may exploit
-- negative numbers as issue even when minus signs aren't in use
-- floating point numbers
-- above ASCII 127, e.g., accented letters, often bad
-- leading period
-- in Win, names like com1.txt that otherwise signify physical devices
-- locales should be checked as hackers may forge a locale to confuse meanings for locale-relevant strings
-- email address checking complex
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.