Re: windows tcl to read unix files



macray wrote:

> I need to write a tcl script for MS windows to read 2 text files in unix
> server. These 2 text files have the same file name but different case letter
> (i.e. A.txt and a.txt) and they are in the unix system. The tcl script needs
> to be executed under MS windows and then through the network to read these 2
> files.

> Does any one know how to do that? I am having troubles because the tcl
> script under MS windows treats these 2 files as one file (it does not
> distinguish the case letter). And so it only opens A.txt whether it read
> "A.txt" or "a.txt".

The problem is not Tcl; the problem lies in the fact that Windows is not
case sensitive (but case-preserving) -- whereas Unix is both -- and in
what means you use to access the file.

You haven't said how your Windows machine accesses this file. The two
most common I can think of are:

1. Unix server exports as Samba share: Windows mounts filesystem
"natively."

2. Unix server exports NFS share: Windows uses something such as
Hummingbird NFSMaestro to mount the share.

In either case, whether it be on the server or the client, some bit of
software is translating the Unix file system into a Windows interface,
and doing an unconvincing job of it. If it is a client-side protocol,
such as an NFS client for Windows, does your client software offer and
"special tricks" for accessing files in a case-sensitive manner?

In the case of a client-side software driver, sometimes, there is a
command-line tool that will do so, even if the driver that makes it
appear to be a "native" share does not.

I've heard it said that "there is no good reason to have to files in the
same directory whose names differ only by case." And, while I'm a
die-hard case-sensitive fan, I can't think of any good reason to do it.
In other words, if you have control over these files, as they are
created, or can rename them on the Unix server, do so.

Another option is to use a tool that is aware of case-sensitivity to
transfer the files. Perhaps you can use `ftp` or `scp` to grab the file
from the unix server? Maybe the directory can be accessed via web
server? Chances are good that a unix web server will serve two
different files at http://example.com/files/foo and
http://example.com/files/Foo.

Different systems always seem to have these glitches. Case sensitivity
is one issue. The old "MacOS classic stores resource forks as files" is
another. Max file name length, and valid characters per filesystem,
etc., etc., etc... In other words, don't go naming files on the unix
server: "this\: is my (File) \{\[is\]\}\n it \t not Nifty?!" and expect
Windows to pick it up, either. :-)


Here's a thought... open cmd.exe on the Windows box. Navigate to the
appropriate directory. Then use:

Q:\my\path> DIR/X

See if both files don't happen to show up with different short (8.3)
file names.

--
MKS
.



Relevant Pages

  • Re: My browser shuts down when attempting to view my website
    ... The Unix server vs. a Windows server issue is just a guess solution. ... Publisher sites don't work well in FF, so that isn't too viable either. ...
    (microsoft.public.publisher.webdesign)
  • Re: Are you truly a M$ desktop alternative?
    ... Of course I'd rather update a single server ... multiple Microsoft patches etc. can be avoided. ... Our users range from Windows NT ... on unix you are not as limited in vendor options as you ...
    (freebsd-questions)
  • Bill Gates Claims
    ... The US military is one of the largest consumers of Unix OS licenses ... and they are quite open about not using Windows because of stability ... Microsoft doesn't have the best products around. ... admins per server with about 500 users per server. ...
    (SecProg)
  • Re: MacMini and Unix
    ... Windows, in face i'm struggling. ... I bought the thing to practice on Unix as I lease some Unix servers to run ... FOR THE LOVE OF FUCKING GOD. ... I'd rather use Redhat 3 than Server 2003. ...
    (comp.sys.mac.advocacy)
  • Re: Can we use Unix as the server?
    ... The server must be Unix ... If so then problem since .net was developed for windows (mono ... I would like to use C#.Net or VB.Net to develop> the C/S package and ASP.Net to develop B/S package. ...
    (microsoft.public.dotnet.framework.adonet)