unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* rename-file gets "Invalid argument" on Windows 10
@ 2022-02-11 20:13 Steinar Bang
  2022-02-11 21:59 ` Óscar Fuentes
  0 siblings, 1 reply; 2+ messages in thread
From: Steinar Bang @ 2022-02-11 20:13 UTC (permalink / raw)
  To: help-gnu-emacs

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?

Thanks!



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: rename-file gets "Invalid argument" on Windows 10
  2022-02-11 20:13 rename-file gets "Invalid argument" on Windows 10 Steinar Bang
@ 2022-02-11 21:59 ` Óscar Fuentes
  0 siblings, 0 replies; 2+ messages in thread
From: Óscar Fuentes @ 2022-02-11 21:59 UTC (permalink / raw)
  To: help-gnu-emacs

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.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-11 21:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-11 20:13 rename-file gets "Invalid argument" on Windows 10 Steinar Bang
2022-02-11 21:59 ` Óscar Fuentes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).