Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question this is not a file name..or is it -->

    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?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 /.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what if there are two of the same file name?..you would need to know the extension to tell them apart.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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).
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    windows is usually very iritating when you try to remove extensions from files. well it is for my win98 why would you want an extensionless file in this example anyways?
    photoshop too expensive? use the GIMP! www.gimp.org

  • #6
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts
    whackaxe
    that was the code i copied from an example.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •