Thread: AppleScript - rename files

  1. #31
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Ah well, so I edited out the failed experiment. No need for that now.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #32
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Eh, no need to edit it out. It looked like a reasonably useful design. Some other AppleScript-turned-C++ programmer who's searching for "applescript" might find it handy, you never know . . .
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #33
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Hehehe... I tend to not edited out any valuable data, but since it's a Windows-only library with a hacked interface and temporary files and a ever-growing, maturing private library, it's better to not distribute it more than necessary.
    I didn't enough out all that was written in the thread; just edited out the post with the actual links and all that and replaced with "experiment failed" so as to not mess up the discussion in the thread.

    [edit] What did I actually do to the library? I actually just added a helper interface or an interface to help bridge the gap to MFC:
    Code:
    std::vector<string>* FindFilesHelper(const string& strFolder, bool bSearchSubFolders,
    const string& strPattern, UINT64* p_nCurrentFile, /*CString* p_strCurrentFile, */
    bool bThread, bool* pThreadFinished, bool* pCancel)
    {
    	pp< vector<CString> > pVector = FindFiles(strFolder.c_str(), bSearchSubFolders,
    		strPattern.c_str(), p_nCurrentFile, NULL, bThread, pThreadFinished, pCancel);
    	//vector<CString>* pRawVector = pVector.Detach();
    	vector<string>* pReturnVector = new vector<string>;
    	for (UINT i = 0; i < pVector->size(); i++)
    		pReturnVector->push_back( (const TCHAR*)pVector->at(i) );
    	return pReturnVector;
    }
    While the original function's prototype is:
    Code:
    pp< vector<CString> > FindFiles(const CString& strFolder, bool bSearchSubFolders, 
    const CString& strPattern, UINT64* pnCurrentFile, CString* pCurrentFile, bool bThread,
    bool* pThreadFinished, bool* pCancel, pp< vector<CString> > pBuffer)
    [/edit]
    Last edited by Elysia; 12-18-2007 at 04:36 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #34
    Registered User
    Join Date
    Dec 2007
    Posts
    12
    Thanks for the perl script, that look quite simple and straightforward...
    as i said before rename() looks like the way to go and i am workin on it atm...

    AppleScript is english like...

    I am determined to get the code going in C or C like language and working on it, I cant thank enough for your help...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Working with muliple source files
    By Swarvy in forum C++ Programming
    Replies: 1
    Last Post: 10-02-2008, 08:36 AM
  2. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 04:45 AM
  3. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  4. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 02:41 PM
  5. Folding@Home Cboard team?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 398
    Last Post: 10-11-2005, 08:44 AM