Python Forum
Windows/DOS python script cannot create a directory name beginning an @ at-sign - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Windows/DOS python script cannot create a directory name beginning an @ at-sign (/thread-3246.html)



Windows/DOS python script cannot create a directory name beginning an @ at-sign - LucRhan - May-08-2017

Dear forum readers,

DOS refuses the creation of a directory which name begins with an "@" (at-sign / at sign).

Unfortunately, I have to create a directory named "@eaDir" (hi, synology photo station users !) within a python script that I want to execute on windows.

The following line raises an error.
os.mkdir("@eaDir")

Does anyone have an idea about how to achieve the creation of directory with an @ at sign at the beginning in a python script executed on windows ?

Thank you !


RE: Windows/DOS python script cannot create a directory name beginning an @ at-sign - Larz60+ - May-08-2017

rewrite windows


RE: Windows/DOS python script cannot create a directory name beginning an @ at-sign - LucRhan - May-08-2017

@volcano63
trolling windows is always fun !
but trolling...


RE: Windows/DOS python script cannot create a directory name beginning an @ at-sign - snippsat - May-08-2017

LucRhan Wrote:The following line raises an error.
What error?
It work for me.
C:\bar
λ ptpython
>>> import os
>>> os.mkdir("@eaDir")
>>> exit()

C:\bar
λ dir
'@eaDir'/  ren.py

C:\bar
λ cd @eaDir
C:\bar\@eaDir



RE: Windows/DOS python script cannot create a directory name beginning an @ at-sign - LucRhan - May-08-2017

(May-08-2017, 11:55 AM)snippsat Wrote:
LucRhan Wrote:The following line raises an error.
What error?
It work for me.
C:\bar
λ ptpython
>>> import os
>>> os.mkdir("@eaDir")
>>> exit()

C:\bar
λ dir
'@eaDir'/  ren.py

C:\bar
λ cd @eaDir
C:\bar\@eaDir

In fact I am executing a python script from a cmd.exe DOS shell.
I have got the same error when trying to create the directory with a DOS command :
Test> mkdir @eaDir
Le fichier spécifié est introuvable (cannot find specified file)
or with a call to python
[url=http://stackoverflow.com/users/205580/eryksun][/url]Test> python.exe -c "import os; os.mkdir('@eaDir')"
Traceback (most recent call last): File "<string>", line 1, in <module> FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable: '@eaDir'


RE: Windows/DOS python script cannot create a directory name beginning an @ at-sign - nilamo - May-08-2017

What version of Windows? I just tried, and it works without issue on Windows 10.


RE: Windows/DOS python script cannot create a directory name beginning an @ at-sign - volcano63 - May-08-2017

(May-08-2017, 11:38 AM)LucRhan Wrote: @volcano63
trolling windows is always fun !
but trolling...
I did not say anything  Naughty

But while we are at it - probably it was French thing Rolleyes