# Lsd (list file) on drive - using on go lang (librclone)

**URL:** <https://forum.rclone.org/t/lsd-list-file-on-drive-using-on-go-lang-librclone/44471>\
**Category:** Dev Discussions\
**Created:** [February 6, 2024, 10:23am UTC](https://forum.rclone.org/t/lsd-list-file-on-drive-using-on-go-lang-librclone/44471 "2024-02-06T10:23:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ikram\_Mert](https://forum.rclone.org/user_avatar/forum.rclone.org/ikram_mert/32/17380_2.png) [@Ikram\_Mert](https://forum.rclone.org/u/Ikram_Mert)\
**Post date:** [February 6, 2024, 10:23am UTC](https://forum.rclone.org/t/lsd-list-file-on-drive-using-on-go-lang-librclone/44471/1 "2024-02-06T10:23:30Z")

</div>

Hi, Im new here,

I'm trying to use rclone on my go code and I'm just find one way to use rclone in my code is librclone  
and i copy file from my local to google drive and its worked

```auto
librclone.Initialize()
	defer librclone.Finalize()
	syncRequest := struct {
		SrcFs string `json:"srcFs"`
		DstFs string `json:"dstFs"`
	}{
		SrcFs: "./deneme",
		DstFs: "gDrive:denemeDrive/",
	}

	syncRequestJSON, err := json.Marshal(syncRequest)
	if err != nil {
		fmt.Println(err)
		return
	}

	out, status := librclone.RPC("sync/copy", string(syncRequestJSON))
	fmt.Printf("Got status: %d and output: %q\n", status, out)

```

but i wanna list my folder in my drive  
on command its `rclone lsd gDrive:` but in go lang  
I'm not find method for lsd (list file)

not: Is there a document somewhere with all the methods?

---

<div class="post-metadata">

**Author:** ![nielash](https://forum.rclone.org/user_avatar/forum.rclone.org/nielash/32/16050_2.png) [@nielash](https://forum.rclone.org/u/nielash)\
**Post date:** [February 6, 2024, 11:29am UTC](https://forum.rclone.org/t/lsd-list-file-on-drive-using-on-go-lang-librclone/44471/2 "2024-02-06T11:29:46Z")

</div>

> [@Ikram\_Mert](#):
>
> but i wanna list my folder in my drive  
> on command its `rclone lsd gDrive:` but in go lang  
> I'm not find method for lsd (list file)

I think you want [`operations/list`](https://rclone.org/rc/#operations-list).

If you want only directories and no files (like `lsd`), then be sure to include:

```auto
"dirsOnly": true

```

If you are marshaling JSON from a Go struct, try something like:

```auto
DirsOnly bool `json:"dirsOnly,omitempty"`

```

> [@Ikram\_Mert](#):
>
> Is there a document somewhere with all the methods?

Yes:

> **[Remote Control / API](https://rclone.org/rc/)**
>
> Remote controlling rclone with its API

---

<div class="post-metadata">

**Author:** ![Ikram\_Mert](https://forum.rclone.org/user_avatar/forum.rclone.org/ikram_mert/32/17380_2.png) [@Ikram\_Mert](https://forum.rclone.org/u/Ikram_Mert)\
**Post date:** [February 6, 2024, 12:08pm UTC](https://forum.rclone.org/t/lsd-list-file-on-drive-using-on-go-lang-librclone/44471/3 "2024-02-06T12:08:44Z")

</div>

thanks, its worked  
How can I set the config file in code?

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [February 6, 2024, 12:16pm UTC](https://forum.rclone.org/t/lsd-list-file-on-drive-using-on-go-lang-librclone/44471/4 "2024-02-06T12:16:18Z")

</div>

> **[Remote Control / API](https://rclone.org/rc/#config-setpath)**
>
> Remote controlling rclone with its API

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [March 7, 2024, 12:16pm UTC](https://forum.rclone.org/t/lsd-list-file-on-drive-using-on-go-lang-librclone/44471/5 "2024-03-07T12:16:46Z")

</div>

Closed on March 7, 2024, 12:16pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
