[Tutor] OS lib creating an directory using an absolute path.

boB Stepp robertvstepp at gmail.com
Sat Feb 6 19:18:58 EST 2021


On Sun, Feb 07, 2021 at 12:03:25AM +0000, Alan Gauld via Tutor wrote:
>On 06/02/2021 23:38, boB Stepp wrote:
>> On Sat, Feb 06, 2021 at 03:49:37AM -0700, Mats Wichmann wrote:
>>
>>> and would really suggest you not use directory names with spaces in
>>> them, it will eventually bring you grief.
>>
>> Out of habit from looong ago when spaces were not allowed at all, I tend
>> not to use spaces in directory/folder names.  But don't all modern
>> operating systems now allow spaces in their directory names?  What would be
>> the potential sources of grief in modern times?
>
>Speaking personally I find filenames/folders with spaces continually
>trip me up, especially in shell scripts and programs. You need to
>remember to always add quotes and escape sequences and be careful
>about splitting paths etc etc.

I take your points about care in quoting and splitting paths, but doesn't
one, nowadays, have to be prepared to deal with potential spaces as well as other
irksome characters?  In the OP's original post it seemed to me the
potential existed for having to deal with directory structures as they were
found and not necessarily as one would want to create them oneself.  But I might not
have been paying close attention.

But I am with you.  If I am the one creating the directories then I will
almost certainly not have any spaces in them, at least if I am programming
and not working in Word, Open Office, etc. and naming a document.  And even
then I have a strong tendency not to use spaces or potentially troublesome
characters.

-- 
Wishing you only the best,

boB Stepp


More information about the Tutor mailing list