create directory when needed in maven

Instead of the exec plugin, use the antrun plugin to first create the directory and then invoke the thrift compiler. <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <configuration> <tasks> <mkdir dir=”target/generated-sources/thrift”/> <exec executable=”${thrift.executable}”> <arg value=”–gen”/> <arg value=”java:beans”/> <arg value=”-o”/> <arg value=”target/generated-sources/thrift”/> <arg value=”src/main/resources/MyThriftMessages.thrift”/> </exec> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> You may also want … Read more

rsync prints “skipping non-regular file” for what appears to be a regular directory

Are you absolutely sure those individual files are not symbolic links? Rsync has a few useful flags such as -l which will “copy symlinks as symlinks”. Adding -l to your command: rsync -rtvpl /source/backup /destination I believe symlinks are skipped by default because they can be a security risk. Check the man page or –help … Read more

How do I recursively create a folder in Win32?

If you don’t need to support Windows versions prior to Windows 2000, you can use the SHCreateDirectoryEx function for this. Consider this: int createDirectoryRecursively( LPCTSTR path ) { return SHCreateDirectoryEx( NULL, path, NULL ); } // … if ( createDirectoryRecursively( T(“C:\\Foo\\Bar\\Baz”) ) == ERROR_SUCCESS ) { // Bingo! } In case using such shell32.dll API … Read more

Can Swift playgrounds see other source files in the same project?

There’s two ways to use your project’s code in a Playground Playground’s Sources Folder Yes, in Xcode 6.3 Beta 3 (and hopefully, into the future): Playgrounds are now represented within Xcode as a bundle with a disclosure triangle that reveals Resources and Sources folders when clicked. These folders contain additional content that is easily accessible … Read more

Iterating through files in a folder with nested folders – Cocoa

Use NSDirectoryEnumerator to recursively enumerate files and directories under the directory you want, and ask it to tell you whether it is a file or directory. The following is based on the example listed at the documentation for -[NSFileManager enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:]: NSFileManager *fileManager = [NSFileManager defaultManager]; NSURL *directoryURL = … // URL pointing to the directory … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)