function result = publishToWeb(webdir,filename) %publishToWeb publish a file to the web % % Examples: % % publishToWeb("cisc106/lab11","foo.wav"); % % % % Create the target web directory if it doesn't already exist mkdirCommand = ['mkdir -p -m 755 ~/public_html/' webdir ]; system(mkdirCommand); % Copy the web file to the destination and make it readable cpCommand = ['cp ' filename ' ~/public_html/' webdir ]; system(cpCommand); chmodCommand = ['chmod 644 ~/public_html/' webdir '/' filename]; system(chmodCommand);