Skip to content

clinet.list() not listing all files??? #272

Description

@Aworldc

Describe the bug
I assume this isn't a bug, but just user error. I'm listing all the files in a directory but no matter which direction I sort by date in, I'm seeing files from 2021, whilst I see files from 2021 through 2026 in filezilla.

Example code

function fileinfo_get_date(file: FileInfo) {
    return file.modifiedAt
        ? file.modifiedAt.valueOf()
        : new Date(file.rawModifiedAt).valueOf()
}

let client = new FtpClient()

client.ftp.verbose = true

await client.access({
    host: 'ftp.bom.gov.au',
    user: 'anonymous'
})

await client.cd('/anon/gen/gms/')

let files = (await client.list())
    .filter(file => new Date(file.rawModifiedAt).getFullYear() != 2001)
    .toSorted((a, b) => fileinfo_get_date(b) - fileinfo_get_date(a))

// Sorting the other way
// let files = (await client.list())
//     .filter(file => new Date(file.rawModifiedAt).getFullYear() != 2001)
//     .toSorted((a, b) => fileinfo_get_date(a) - fileinfo_get_date(b))

console.log(files[0])

Console output
is 13,000 lines (not sure if that's normal) and I'm not pasting that straight into this issue so here: log.txt

Which version of Node.js are you using?
v20.19.6

Which version of basic-ftp are you using?
v5.1.0

Additional context
Ftp server run by the government, so while I don't know what ftp server it is, I'd assume it's the oldest, buggiest server around, misconfigured in every possible way.

What filezilla shows:

Image

Sorry for what is probably a crap bug report. I'm very new to ftp in general, and just trying to get things working.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions