Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LuajitError: builtin/fio.lua:544: pathname is absent #10

Closed
racherb opened this issue Apr 9, 2021 · 2 comments
Closed

LuajitError: builtin/fio.lua:544: pathname is absent #10

racherb opened this issue Apr 9, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@racherb
Copy link
Owner

racherb commented Apr 9, 2021

Describe the bug
File watcher fails when passing the file sort parameters for date 'MA' or 'MD' with the following error message:
main/119/file-watcher-bulk-d utils.c:1014 E> LuajitError: builtin/fio.lua:544: pathname is absent

To Reproduce
Steps to reproduce the behavior:

  1. Execute the following shell script:
#!/usr/bin/env tarantool

local file_watcher=require('watcher').file
local fiber=require('fiber')

local function remove_file(file, waitfor)
    fiber.sleep(waitfor)
    os.remove(file)
end

os.execute('touch /tmp/f_G.txt')
os.execute('touch /tmp/f_H.txt')
os.execute('touch /tmp/f_I.txt')
os.execute('touch /tmp/f_J.txt')
os.execute('touch /tmp/f_K.txt')
os.execute('touch /tmp/f_L.txt')

local n_match = 2

fiber.create(remove_file, '/tmp/f_G.txt', 2)
fiber.create(remove_file, '/tmp/f_L.txt', 2)
fiber.create(remove_file, '/tmp/f_K.txt', 2)

local ini = os.time()

local SORT_BY = {
    NO_SORT = 'NS',
    ALPHA_ASC = 'AA',
    ALPHA_DSC = 'AD',
    MTIME_ASC = 'MA',
    MTIME_DSC = 'MD'
}

local sort_by = SORT_BY.MTIME_ASC

--This fail for SORT_BY.MTIME_ASC and SORT_BY.MTIME_DSC
res = file_watcher.deletion({'/tmp/f_*'}, 5, 0.5, {'MA', 3, 2})

print('Elapsed time: ' .. os.difftime(os.time() - ini) .. 's')

print(res.wid)
print(res.ans)

os.exit()
  1. See error

Expected behavior
The system should work equally well for the different types of file sorting: NO_SORT = 'NS', ALPHA_ASC = 'AA', ALPHA_DSC = 'AD', MTIME_ASC = 'MA' and MTIME_DSC = 'MD'.

@racherb racherb self-assigned this Apr 9, 2021
@racherb racherb added the bug Something isn't working label Apr 9, 2021
@github-actions
Copy link

github-actions bot commented Apr 9, 2021

Message that will be displayed on users' first issue

racherb added a commit that referenced this issue Apr 9, 2021
Issue #10 'pathname is absent' solution
@racherb
Copy link
Owner Author

racherb commented Apr 9, 2021

Solution applied in commit db8b5e8e8e2d74341fcd07cbfb44f103cb092786d6

@racherb racherb closed this as completed Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant