ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to do a piece os software which encrypts and decrypts filenames... and I ddn't find anyhting simple and basic in linux...
so I started with a simple c++++ program using ftream etc etc..
however I didn't find a function to edit the filename of a file.. I tried therefore to copy a video content to another with this program but the program hangs??? why???
operator >> discards the end of line character.. which in a binary file such as avi, is actual data.. so do not use it even in binary mode..
do as -X- suggested and open in binary mode and then you can use read and write inside your while loop.. read and write are the standard way to handle binary files..
you need to read up on fstream and see how file streams are handled.. that should make things clearer.
Now do you know a function which handles filenames? to change them I mean? I searched through ifstream ofstream etc and didn't find any.. any hint? thanks a lot
thank you so much..
I figured it out and now it works... could you help me for the last part of the program?
How do I encrypt a string (the filename)??? is there a standard c++ library which does it???
because I couldn't find it.. thanks so much
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.