help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rename-file gets "Invalid argument" on Windows 10


From: Óscar Fuentes
Subject: Re: rename-file gets "Invalid argument" on Windows 10
Date: Fri, 11 Feb 2022 22:59:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Steinar Bang <sb@dod.no> writes:

> Platform: Windows 10,
>           GNU Emacs 27.2 (build 1, x86_64-w64-mingw32) of 2021-03-26
>
> I get the following error
>  Debugger entered--Lisp error: (file-error "Renaming" #("Invalid argument" 0 
> 16 (charset windows-1252)) "c:/Users/sb/News/nnimap+privat:INBOX.SCORE" 
> "c:/Users/sb/News/nnimap+privat:INBOX.SCORE~")
>
> when running this function:
>  (rename-file "~/News/nnimap+privat:INBOX.SCORE" 
> "~/News/nnimap+privat:INBOX.SCORE~" t)
>
> Except for the directions of the slashes there is a file at the path
> "c:/Users/sb/News/nnimap+privat:INBOX.SCORE".
>
> There is also a file at "c:/Users/sb/News/nnimap+privat:INBOX.SCORE~",
> but the third t argument of rename-file should take care of that...?
>
> Any ideas?
>
> I have tried turning the slashes into backslashes (and doubling them),
> but I get the same error (with forward slashes).
>
> Are there any of the other characters in the file name that may cause
> problems on the windows file system?  If so, is there a way to work
> around them, given that I can't do anything about the file names?

`:' is not a legal character on Windows file names.

See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
for more details.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]