Re: [LAD] OT.C Library for mounting, processing data

From: Patrick Shirkey <pshirkey@email-addr-hidden>
Date: Fri Mar 28 2008 - 22:22:20 EET

Patrick Shirkey wrote:
> Markus Schwarzenberg wrote:
>
>> On Fri, 28 Mar 2008 15:07:21 +0700 Patrick Shirkey <pshirkey@email-addr-hidden> wrote:
>>
>>
>>
>>> Hi,
>>>
>>> Can anyone point me to a library that lets me mount a disk, copy data to
>>> the disk and unmount the disk?
>>>
>>>
>> regarding cp: if you do this in c++, you might want to use
>>
>> boost::filesystem::copy_file()
>>
>>
>>
>
> Thanks. This is quite a good selection so far.
>
> I wonder why nothing relevant shows up for me with google?
>
> It's all webpages talking about how to mount a device from CLI...
>
>

Actually, it's kind of funny to see this kind of response on this list.
Most of the time it's much more high brow. We don't often get this more
simple "how do I code xxx" kind of thread.

Yesterday I was reading about the latest open source forum where people
were suggesting some things that M$ have done well vs things that OS
developers do well and in many respects the amount of advice available
on how to write various base functions is much more accessible for
windows developers.

Although we have free code we don't always have accessible info on using
it or understanding it.

It's a good thing this list has so many competent people reading it and
responding quickly.

That's one thing we have over most of the M$ focused list and forums.
Super fast response times to the common knowledge of our community.

> Cheers.
>
>
>> it's very c++ish, (see below) and less platform dependent.
>> See http://www.boost.org/libs/filesystem/doc/index.htm
>> There is a lot of nice stuff there ...
>>
>> Complete example:
>>
>> Source File: copy_file.cc
>> #include <boost/filesystem/operations.hpp>
>> int main(void)
>> {
>> boost::filesystem::path p("file1");
>> boost::filesystem::path p2("file2");
>> boost::filesystem::copy_file(p, p2);
>> return 0;
>> }
>>
>> compile:
>> % g++ copy_file.cc -l boost_filesystem
>>
>> try out:
>>
>> % ./a.out
>> terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
>> what(): boost::filesystem::copy_file: "file1", "file2": No such file or directory
>> Aborted
>>
>> # OK, create the missing file and try again:
>> % touch file1
>> % ls file?
>> file1
>> % ./a.out
>> % ls file?
>> file1 file2
>>
>> # Try once more
>> % ./a.out
>> terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
>> what(): boost::filesystem::copy_file: "file1", "file2": File exists
>> Aborted
>>
>> --
>> Markus Schwarzenberg
>>
>> _______________________________________________
>> Linux-audio-dev mailing list
>> Linux-audio-dev@email-addr-hidden
>> http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
>>
>>
>
>
>

-- 
Patrick Shirkey
Boost Hardware Ltd.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Sat Mar 29 04:15:05 2008

This archive was generated by hypermail 2.1.8 : Sat Mar 29 2008 - 04:15:06 EET