Page 1 of 1

Can place spaces at begin of file or folder name

Posted: 08 Nov 2010, 00:43
by Pasha T.
Can place spaces at begin of file or folder name.
For example i can rename file "File.txt" to " File.txt" (one space) or " File.txt" (two spaces).

Other question:
hoc i can find files and folders with spaces at begin of its names?

Re: Can place spaces at begin of file or folder name

Posted: 08 Nov 2010, 05:28
by SelfMan
Even windows explorer strips the spaces in the front of the filename.
If you can find files with spaces in the front, then they are created by some programs.
You have to learn to live with it.

Re: Can place spaces at begin of file or folder name

Posted: 08 Nov 2010, 09:49
by Jan Rysavy
Pasha T. wrote:Can place spaces at begin of file or folder name.
For example i can rename file "File.txt" to " File.txt" (one space) or " File.txt" (two spaces).
You cannot with Altap Salamander. Spaces will be stripped.

If you can, there is something wrong and let us know more details please...

Re: Can place spaces at begin of file or folder name

Posted: 08 Nov 2010, 10:37
by Pasha T.
Use F2 (Rename function) and place space at begin.

http://www.youtube.com/watch?v=-31A4Dv_uPU

Re: Can place spaces at begin of file or folder name

Posted: 08 Nov 2010, 10:42
by Pasha T.
When move file with spaces at begin of name - Explorer delete spaces without prompting.I think need to add this function to Salamander.

Re: Can place spaces at begin of file or folder name

Posted: 08 Nov 2010, 10:51
by Jan Rysavy
Nice :)

We will fix it, thank you!

Re: Can place spaces at begin of file or folder name

Posted: 08 Nov 2010, 16:17
by therube
There may not be anything inherently wrong with spaces at the beginning of a file name?

Naming Files, Paths, and Namespaces

(I have no idea as to time frame of that article.)

Even from DOS you can create file names beginning with spaces.

Code: Select all

C:\TMP>DIR "  R*"

 Directory of C:\TMP\

10/31/2010  12:56 PM            42,092   REAL.rents.1011
               1 File(s)         42,092 bytes
               0 Dir(s)     734,060,544 bytes free

C:\TMP>REN "  REAL.RENTS.1011" " REAL.RENTS.1011"

C:\TMP>DIR > XXX

C:\TMP>DIR
 Directory of C:\TMP

11/08/2010  10:03 AM    <DIR>          .
11/08/2010  10:03 AM    <DIR>          ..
10/31/2010  12:56 PM            42,092  REAL.RENTS.1011
11/08/2010  10:03 AM               381 XXX
               2 File(s)         42,473 bytes
               2 Dir(s)     733,990,912 bytes free


C:\TMP>dir > "   xxx"


C:\TMP>dir

 Directory of C:\TMP

11/08/2010  10:10 AM    <DIR>          .
11/08/2010  10:10 AM    <DIR>          ..
11/08/2010  10:10 AM               428    xxx
10/31/2010  12:56 PM            42,092  REAL.RENTS.1011
11/08/2010  10:03 AM               381 XXX
               3 File(s)         42,901 bytes
               2 Dir(s)     733,548,544 bytes free

C:\TMP>
Not saying you necessarily want the ability to have spaces at the beginning of a file name, but ...

Re: Can place spaces at begin of file or folder name

Posted: 08 Nov 2010, 21:57
by Ether
therube wrote:There may not be anything inherently wrong with spaces at the beginning of a file name?
It's slightly more wrong than placing a space inside the name. Use of spaces inside the filename causes issues with command line interfaces, but that is mostly past us(*). On the other hand, all serious filename input fields are filtered for spaces at the both ends of the name, so that a random trailing (or preceding) space won't cause an error - the reason is hard to spot (because spaces are...ehm... whitespace, and therefore not visible). Therefore filenames with spaces on either end are unaccessible under some circumstances and therefore they're wrong.

*) I'm talking about Windows. Because of extensive usage of CLI on *nixes, it's customary to avoid any spaces in filenames there.

Re: Can place spaces at begin of file or folder name

Posted: 07 Jun 2012, 14:06
by Petr Solin
Fixed. You cannot rename file or directory to name with space at the beginning or space or dot at end.

Moreover we have supported operations with directories with spaces or dots at end of name. Such names are not supported by Windows Explorer, but unfortunately they can exist on Windows file system (e.g. "test " or "test..."). Even directory with name " " (just one space character) can exist. You will be able to copy, move, rename, and delete them and change their attributes in Altap Salamander 3.0. Drag&drop is blocked on these paths (Windows Explorer provides data objects for drag&drop and it does not support such names). Context menu for such names is also partially blocked, it is not working properly in all situations (again context menu is service of Windows Explorer which does not support such names).

Salamander 3.0 rejects to create such dangerous names. It's not possible to create such directory with Create Directory command nor when specified as new directory in target path of Copy, Move, or Unpack operations.

File names can also end with space or dot. Then they are inaccessible for the most of applications, Salamander 3.0 rejects common operations with such files. If you have not disabled short names on your file system, you can rename or delete such file in Salamander 3.0.

Re: Can place spaces at begin of file or folder name

Posted: 07 Jun 2012, 16:37
by Ether
Thanks. What happens if I have disabled 8.3 filenames?

Re: Can place spaces at begin of file or folder name

Posted: 07 Jun 2012, 23:12
by Petr Solin
All operations with directories work. Files which names are ending with space or dot are inaccessible from Salamander. We can solve it later if someone will have troubles with it.

Re: Can place spaces at begin of file or folder name

Posted: 14 Mar 2014, 14:12
by XavierB
Well that's a shame... I suppose it's OK for Salamander v3 to strip spaces from filenames by default, but why can't we have an option to allow those characters if we want to? I for one use leading spaces in filenames as a way to force important files (" ReadMe.txt" for example) to show at the top.

Also, when v3 copies files with a leading (or trailing) space to another directory it strips the leading space(s) from the filename. I don't think it's the right thing to do - I would expect Salamander to copy everything exactly as it is.

Re: Can place spaces at begin of file or folder name

Posted: 16 Oct 2015, 12:35
by Petr Solin
Files and directories should be copied with the same name when you use operation mask *.* (it is default). I have tested this and it seems working well. If it is not working for you properly, please let me know, we should fix it. Thanks!