Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Problem with backslash characters
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Justin_




PostPosted: Sun Jan 22, 2006 5:35 pm   Post subject: Problem with backslash characters

You will either know the answer to this, or not. My final project has just one bug in it, and once its fixed I'm confident it will be flawless. It has to do with the fact that '\''s are in some urls. When I open a file to write to, if the url has an '\''s that is back slashes in it, then it will fail to open because it thinks the backslashes are there to specify a new directory. Is there a way to solve this?

Martin says: http://compsci.ca/v2/viewtopic.php?t=461
Sponsor
Sponsor
Sponsor
sponsor
Justin_




PostPosted: Sun Jan 22, 2006 5:43 pm   Post subject: (No subject)

I'm thinking the "\" convention is a windows thing so there's no way to name a file that contains "\" in it. If so, is there some workaround?
Justin_




PostPosted: Sun Jan 22, 2006 5:48 pm   Post subject: (No subject)

Okay, new question. How would you save a link to a webpage that contains '\" in it, so that if you double click link it will take you to the write page. There is a way to do this, any ideas?
Cervantes




PostPosted: Sun Jan 22, 2006 6:31 pm   Post subject: (No subject)

You have to escape the "\" character. To escape a character, you place a "\" in front of it. So instead of using "\" you have to use "\\". Alternatively, you can use a single forward slash, "/".

For your most recent question, URL's use forward slashes. Confused
Justin_




PostPosted: Sun Jan 22, 2006 10:50 pm   Post subject: (No subject)

True, however if you try to open a file and name it the url to which whose strings it will contain windows error checking will convert the forward slashes to back slashes and this will ultimately confuse it and try to open a file in a new DIRECTORY.

So again, does anyone know how to deal with this? Cause I'd like to have these files be executed by the web browser when their called. There is a technique that is used, I just don't know it.
Delos




PostPosted: Sun Jan 22, 2006 10:53 pm   Post subject: (No subject)

AFAIK, what Cervantes said works. Try that out and see if it solves your problem (the double \\ part).
Justin_




PostPosted: Sun Jan 22, 2006 11:29 pm   Post subject: (No subject)

No I think you fail to understand. (By the way what does AFAIK mean?)

I know all about escape characters which is why I can tell you they are of no use. The file names are not being written by hand par ce. They are stored in string variables and sent there by a spider process. You cannot name a file something with backslashes in it, so there is an alternative technique that is used. Does anyone know it?
Martin




PostPosted: Mon Jan 23, 2006 12:23 am   Post subject: (No subject)

http://www.google.com/
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: