[erlang-questions] raw_read_file_info

Loïc Hoguin essen@REDACTED
Wed Jun 25 13:05:39 CEST 2014


Hello,

The file.erl module contains:

  392 %% Obsolete, undocumented, local node only, don't use!.
  393 %% XXX to be removed.
  394 raw_read_file_info(Name) ->
  395     Args = [file_name(Name)],
  396     case check_args(Args) of
  397     ok ->
  398         [FileName] = Args,
  399         ?PRIM_FILE:read_file_info(FileName);
  400     Error ->
  401         Error
  402     end.
  403
  404 %% Obsolete, undocumented, local node only, don't use!.
  405 %% XXX to be removed.
  406 raw_write_file_info(Name, #file_info{} = Info) ->
  407     Args = [file_name(Name)],
  408     case check_args(Args) of
  409     ok ->
  410         [FileName] = Args,
  411         ?PRIM_FILE:write_file_info(FileName, Info);
  412     Error ->
  413         Error
  414     end.

Why obsolete, undocumented, and don't use? I really could use that in 
Cowboy, because we always serve local files, and going through the file 
server is a pretty big bottleneck.

In general I think that all operations that go through a central server 
"for distributed reasons" should have their local equivalent, for when 
you know that's what you need. (And that beats calling prim_file and 
others directly...)

-- 
Loïc Hoguin
http://ninenines.eu



More information about the erlang-questions mailing list