[Tutor] Files and file attributes

D-Man dsh8290@rit.edu
Thu, 22 Feb 2001 11:08:30 -0500


On Thu, Feb 22, 2001 at 04:14:12PM +0100, J=F6rg W=F6lke wrote:
| > > On Thu, Feb 22, 2001 at 10:42:38AM +0100, Remco Gerlich wrote:
| > > | On Wed, Feb 21, 2001 at 07:46:14PM -0500, D-Man wrote:
| > > | I repeat my favorite solution, as I see everybody else omits it :=
)
| > > |=20
| > > | f =3D open("c:/tmp/testfile","r+")
| > > |=20
| > > | Windows is perfectly ok with forward slashes. They keep it a bit =
of a
| > secret
| > > | though...
| >=20
| > is this a "Windows" feature or a Python induced platform specific
| > translation?
| > I thought forward slashes were used for something like environmental
| > variables or something. ???
|=20
| Jo -- windows interprets the string following a slash as a commandline
| argument.

At least, in a DOS shell it does.  Then the question becomes  Is it
Windows or the DOS shell that interprets slash in that manner?  I use
bash anyways so I use / for paths (and use cygpath to convert it for
Windows-only apps) and - or -- for arguments usually.  I don't use the
DOS utilities that want / for arguments.

Java also allows using / for a path delimiter in some contexts (such
as this.getClass().getResource(
"/path/to/some/resource/probably/in/a/jar/file" ) )

I suppose one way to test that would be to write a C/C++ app that used
a forward slash and see if it works.  If not, then it is a Python
feature, not a Windows one.

-D