My preference is relative paths. Eventually you'll want to release
this as a gem to other developers, and they might not have the exact
some directory structure that you do.
then to return an instance of this class :
VALUE alias = rb_eval_string("RAliasFile.new(arg)");
VALUE alias = rb_class_new_instance( 1, args, RAliasFile );
Where 1 is the number of arguments in the args array, args is the
array of arguments (as a VALUE*), and RAliasFile is a reference to the
class you would like to create.
also is my dir hierarchy shown above the best way ?
Unless you need separate modules, I would flatten your directory tree
-- i.e. consolidate all the files in your ext/lib folder up into the
ext folder.
any comment appreciated
Hope these were helpful suggestions.
Blessings,
TwP
···
On 8/3/07, unbewust <yvon.thoraval@gmail.com> wrote:
in fact i want to make something like FileUtils (included in ruby now)
BUT for the files on Mac OS X.
that's to say being able to create alias file, alias record, put files
in the trash and letting the file manager and also the alias manager
knows where everything is.
this would allow to "untrash" a file and/or a directory...
thanks a lot !
Yvon
···
On 3 août, 17:17, "Tim Pease" <tim.pe...@gmail.com> wrote:
Unless you need separate modules, I would flatten your directory tree
-- i.e. consolidate all the files in your ext/lib folder up into the
ext folder.
OK with relative path this is OK now, the prob arroses because my ruby
file to test was in another folder.
BUT i still have prob with "rb_require('raf/raliasfile');" :
//make => rosxutils.c:105: warning: passing argument 1 of rb_require
makes pointer from integer without a cast
// run => ./sample.rb:124: [BUG] Segmentation fault
may be it's only the form of the argument in cause here ie 'raf/
raliasfile' (see make result).
remarks here my set-up is still with a sub-dir (renamed raf instead of
lib) :
My preference is relative paths. Eventually you'll want to release
this as a gem to other developers, and they might not have the exact
some directory structure that you do.
> then to return an instance of this class :
> VALUE alias = rb_eval_string("RAliasFile.new(arg)");
VALUE alias = rb_class_new_instance( 1, args, RAliasFile );
Where 1 is the number of arguments in the args array, args is the
array of arguments (as a VALUE*), and RAliasFile is a reference to the
class you would like to create.
> also is my dir hierarchy shown above the best way ?
Unless you need separate modules, I would flatten your directory tree
-- i.e. consolidate all the files in your ext/lib folder up into the
ext folder.
At Sat, 4 Aug 2007 18:10:02 +0900,
unbewust wrote in [ruby-talk:263323]:
BUT i still have prob with "rb_require('raf/raliasfile');" :
//make => rosxutils.c:105: warning: passing argument 1 of rb_require
makes pointer from integer without a cast
String literal in C must be enclosed with double-quotes, not
single-quotes. Multiple characters inside single-quotes would
be an OSX specific extension, perhaps inherited from old MacOS.
BUT i still have prob with "rb_require('raf/raliasfile');" :
//make => rosxutils.c:105: warning: passing argument 1 of rb_require
makes pointer from integer without a cast
// run => ./sample.rb:124: [BUG] Segmentation fault
may be it's only the form of the argument in cause here ie 'raf/
raliasfile' (see make result).
Would
"rb_require(\"raf/raliasfile\");"
help?
(I.e replace the single quotes w/ escaped double quotes, within the
double quoted string literal.)
HTH
Alec Ross
···
In message <1186218389.734291.96330@o61g2000hsh.googlegroups.com>, unbewust <yvon.thoraval@gmail.com> writes
On 3 août, 17:17, "Tim Pease" <tim.pe...@gmail.com> wrote:
On 8/3/07, unbewust <yvon.thora...@gmail.com> wrote:
BUT i still have prob with "rb_require('raf/raliasfile');" :
//make => rosxutils.c:105: warning: passing argument 1 of rb_require
makes pointer from integer without a cast
String literal in C must be enclosed with double-quotes, not
single-quotes. Multiple characters inside single-quotes would
be an OSX specific extension, perhaps inherited from old MacOS.
It's not specifically an extension - it's a multiple byte character. The literal 'riffraff' would form a long-long (on some architures), containing those ASCII codes all packed into its bits.
That's why the compiler ignores any trailing characters that don't fit into its integer type, then issues a bizarre complain't about converting an integer to a pointer. "" decays to a pointer.
At Sat, 4 Aug 2007 22:39:22 +0900,
Phlip wrote in [ruby-talk:263340]:
>> BUT i still have prob with "rb_require('raf/raliasfile');" :
>> //make => rosxutils.c:105: warning: passing argument 1 of rb_require
>> makes pointer from integer without a cast
>
> String literal in C must be enclosed with double-quotes, not
> single-quotes. Multiple characters inside single-quotes would
> be an OSX specific extension, perhaps inherited from old MacOS.
It's not specifically an extension - it's a multiple byte character. The
I meant it would not be defined by C89, C99 nor K&R. In C++,
it is called as "multicharacter literal", but an
implementation-defined feature.