/* * call-seq: * File.writable?(file_name) => true or false * * Returns <code>true</code> if the named file is writable by the effective * user id of this process. */ static VALUE test_w(obj, fname) VALUE obj, fname; { SafeStringValue(fname); if (eaccess(StringValueCStr(fname), W_OK) < 0) return Qfalse; return Qtrue; }