Moving files from a directory to another

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Moving files from a directory to another

luciano de souza-2
Hello listers,

What's the Lua function to move a file from one directory to another?

Regards,
--
Luciano de Souza

Reply | Threaded
Open this post in threaded view
|

Re: Moving files from a directory to another

Paul E. Merrell, J.D.
On Wed, Sep 30, 2015 at 4:38 PM, luciano de souza <[hidden email]> wrote:
> Hello listers,
>
> What's the Lua function to move a file from one directory to another?

See <https://keplerproject.github.io/luafacilesystem/manual.html>.

Best regards,

Paul

--
[Notice not included in the above original message:  The U.S. National
Security Agency neither confirms nor denies that it intercepted this
message.]

Reply | Threaded
Open this post in threaded view
|

Re: Moving files from a directory to another

Luiz Henrique de Figueiredo
In reply to this post by luciano de souza-2
> What's the Lua function to move a file from one directory to another?

os.rename should do that, but note that you need to supply the name
in both cases, that is, things like this do not work:
        os.rename("./foo.txt", "/tmp")
You need to do
        os.rename("./foo.txt", "/tmp/foo.txt")

See man rename.

Reply | Threaded
Open this post in threaded view
|

Re: Moving files from a directory to another

Choonster TheMage
In reply to this post by Paul E. Merrell, J.D.
On 1 October 2015 at 10:13, Paul Merrell <[hidden email]> wrote:

> On Wed, Sep 30, 2015 at 4:38 PM, luciano de souza <[hidden email]> wrote:
>> Hello listers,
>>
>> What's the Lua function to move a file from one directory to another?
>
> See <https://keplerproject.github.io/luafacilesystem/manual.html>.
>
> Best regards,
>
> Paul
>
> --
> [Notice not included in the above original message:  The U.S. National
> Security Agency neither confirms nor denies that it intercepted this
> message.]
>

I think you mean file, not facile:

https://keplerproject.github.io/luafilesystem/manual.html