...

View Full Version : this is not a file name..or is it -->



velious
02-26-2004, 09:36 PM
this python string:

f=open('/tmp/workfile', 'w')

my tutorial says that this string contains a file name. Well, where is the file name?. File names have extensions like .exe or .txt.

workfile does not have an extension so even if it was a file there could be more than one workfile. Like a workfile.txt and a workfile.exe...

workfile could also be a directory..I'm confused. also what is /temp?

Roy Sinclair
02-26-2004, 10:22 PM
File names have extensions like .exe or .txt.

Nope, files can be present without any "extension" at all.

If you wanted to make sure that pointed to a directory you'd need to end it with another /.

velious
02-27-2004, 10:01 PM
what if there are two of the same file name?..you would need to know the extension to tell them apart.

Roy Sinclair
02-27-2004, 10:05 PM
Originally posted by velious
what if there are two of the same file name?..you would need to know the extension to tell them apart.

Nope, in order for there to be two with the same name they'd have to be in different directories. Names are always unique within a single directory (name includes all extensions).

whackaxe
02-27-2004, 11:14 PM
windows is usually very iritating when you try to remove extensions from files. well it is for my win98:p why would you want an extensionless file in this example anyways?

velious
02-28-2004, 01:26 AM
whackaxe
that was the code i copied from an example.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum