<commit_before>%% ===================================================================
%% @author <NAME>
%% @copyright (C): 2013 ACK CYFRONET AGH
%% This software is released under the MIT license 
%% cited in 'LICENSE.txt'.
%% @end
%% ===================================================================
%% @doc: This module gives high level DB API which contain veil file system specific methods.
%% All DAO API functions should not be called directly. Call dao:handle(_, {vfs, MethodName, ListOfArgs) instead.
%% See dao:handle/2 for more details.
%% @end
%% ===================================================================
-module(dao_vfs).

-include_lib("veil_modules/dao/dao.hrl").
-include_lib("veil_modules/dao/dao_helper.hrl").
-include_lib("veil_modules/dao/dao_types.hrl").
-include_lib("files_common.hrl").

%% API - File system management
-export([list_dir/3, rename_file/2, lock_file/3, unlock_file/3, test/0]). %% High level API functions
-export([save_descriptor/1, remove_descriptor/1, get_descriptor/1, list_descriptors/3]). %% Base descriptor management API functions
-export([save_file/1, remove_file/1, get_file/1, get_path_info/1]). %% Base file management API function


-ifdef(TEST).
-compile([export_all]).
-endif.

%% ===================================================================
%% API functions
%% ===================================================================

test() ->
    {ok, Dir1} = save_file(#file{name = "users", type = ?DIR_TYPE}),
    {ok, Dir2} = save_file(#file{name = "plgroxeon", parent = Dir1, type = ?DIR_TYPE}),
    {ok, Dir3} = save_file(#file{name = "plgroxeon2", parent = Dir1, type = ?DIR_TYPE}),
    save_file(#file{name = "file1", parent = Dir2}),
    save_file(#file{name = "file2", parent = Dir2}),
    {ok, Dir4} = save_file(#file{name = "dir1", parent = Dir2, type = ?DIR_TYPE}),
    save_file(#file{name = "dir2", parent = Dir2, type = ?DIR_TYPE}),
    {ok, File1} = save_file(#file{name = "file3", parent = Dir4}),
    {ok, File2} = save_file(#file{name = "file4", parent = Dir4}),
    save_file(#file{name = "file5", parent = Dir4}),

    save_descriptor(#file_descriptor{file = File1, fuse_id = "fuse1"}),
    save_descriptor(#file_descriptor{file = File1, fuse_id = "fuse2"}),
    save_descriptor(#file_descriptor{file = File1, fuse_id = "fuse3"}),
    save_descriptor(#file_descriptor{file = File1, fuse_id = "fuse4"}),
    save_descriptor(#file_descriptor{file = File2, fuse_id = "fuse1"}),
    save_descriptor(#file_descriptor{file = File2, fuse_id = "fuse2"}),
    save_descriptor(#file_descriptor{file = File2, fuse_id = "fuse3"}),
    ok.


%% ===================================================================<commit_msg>VFS-82: cleanup<commit_after>%% ===================================================================
%% @author <NAME>
%% @copyright (C): 2013 ACK CYFRONET AGH
%% This software is released under the MIT license 
%% cited in 'LICENSE.txt'.
%% @end
%% ===================================================================
%% @doc: This module gives high level DB API which contain veil file system specific methods.
%% All DAO API functions should not be called directly. Call dao:handle(_, {vfs, MethodName, ListOfArgs) instead.
%% See dao:handle/2 for more details.
%% @end
%% ===================================================================
-module(dao_vfs).

-include_lib("veil_modules/dao/dao.hrl").
-include_lib("veil_modules/dao/dao_helper.hrl").
-include_lib("veil_modules/dao/dao_types.hrl").
-include_lib("files_common.hrl").

%% API - File system management
-export([list_dir/3, rename_file/2, lock_file/3, unlock_file/3]). %% High level API functions
-export([save_descriptor/1, remove_descriptor/1, get_descriptor/1, list_descriptors/3]). %% Base descriptor management API functions
-export([save_file/1, remove_file/1, get_file/1, get_path_info/1]). %% Base file management API function


-ifdef(TEST).
-compile([export_all]).
-endif.

%% ===================================================================
%% API functions
%% ===================================================================

%% ===================================================================
{'fraction_non_alphanumeric': 0.32519741564967697, 'fraction_numerical': 0.017707585546781528, 'mean_word_length': 6.219343696027634, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7536119', 'n_tokens_mistral': 1289, 'n_tokens_neox': 1200, 'n_words': 286}