Why backslash means different things on Windows and the Internet

In FTP folders are available as folder/myfolder/another . But the Windows system uses folder\myfolder\another .

Are there any reasons why they are different?

+4
source share
3 answers

The forward slashes ( / ) were used as path separators on many operating systems, such as any Unix, OS X, while Windows and DOS almost exclusively use the backslash ( \ ).

  • So this will be Windows: C:\dir\file.txt

  • And this will be Unix: /dir/file.txt

There are no real advantages or disadvantages; it is just a matter of agreement.

Since "normal" URLs, such as ftp://example.com/file , are more or less standardized, you will never find backslashes in them.

+3
source

The story behind the path separator on Windows is detailed in this blog post by Larry Osterman. FTP follows the UNIX convention.

+4
source

There is a question where the backslash of Windows ( \ ) comes from superuser.com with a fairly complete answer.

Basically, a slash ( / ) was already used for command parameters, such as

 dir /p 

to suspend the directory list after each page, so \ used instead of the path separator when DOS started supporting hierarchical file systems.

+1
source

Source: https://habr.com/ru/post/1342964/


All Articles